css bullshit- fuck nik
This commit is contained in:
parent
e65c99017f
commit
5282fe8de3
BIN
cache/ArticlesGenerator-Readers
vendored
Normal file
BIN
cache/ArticlesGenerator-Readers
vendored
Normal file
Binary file not shown.
BIN
cache/PagesGenerator-Readers
vendored
Normal file
BIN
cache/PagesGenerator-Readers
vendored
Normal file
Binary file not shown.
|
@ -23,7 +23,7 @@ This will list keys such as
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
pub 4096R/01A53981 2011-11-09 [expires: 2016-11-07]
|
pub 4096R/01A53981 2011-11-09 [expires: 2016-11-07]
|
||||||
uid Tyrel Anthony Souza (Five year key for email.)
|
uid Tyrel Anthony Souza (Five year key for email.)
|
||||||
sub 4096R/C482F56D 2011-11-09 [expires: 2016-11-07]
|
sub 4096R/C482F56D 2011-11-09 [expires: 2016-11-07]
|
||||||
|
|
||||||
To make this not expire, (same steps to change expiration date to another time), you must first edit the key
|
To make this not expire, (same steps to change expiration date to another time), you must first edit the key
|
||||||
|
@ -42,11 +42,11 @@ Type “expire” in and you will be prompted for how long to change it to
|
||||||
|
|
||||||
Changing expiration time for the primary key.
|
Changing expiration time for the primary key.
|
||||||
Please specify how long the key should be valid.
|
Please specify how long the key should be valid.
|
||||||
0 = key does not expire
|
0 = key does not expire
|
||||||
<n> = key expires in n days
|
<n> = key expires in n days
|
||||||
<n>w = key expires in n weeks
|
<n>w = key expires in n weeks
|
||||||
<n>m = key expires in n months
|
<n>m = key expires in n months
|
||||||
<n>y = key expires in n years
|
<n>y = key expires in n years
|
||||||
|
|
||||||
You are then done setting the expiration on the primary key, if you have sub key, doing this is as easy as typing ``key 1`` and repeating the expiration step.
|
You are then done setting the expiration on the primary key, if you have sub key, doing this is as easy as typing ``key 1`` and repeating the expiration step.
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ Some BASH tips
|
||||||
:slug: some-bash-tips
|
:slug: some-bash-tips
|
||||||
:status: published
|
:status: published
|
||||||
|
|
||||||
I realize I haven’t updated in a while. I haven’t had much free time recently as I’ve been working on a project for my father in C# after work hours. This is a great change from only working in Python and JavaScript recently. I’m making a program that will analyze test results from a plasma torch for a company called HyperTherm. My father built the physical machine, but the employees want something that they can better see the results of a passed torch unit, or a failed torch unit. This program has a bar code scanner that scans the tool used in the test and matches it up to the lot of torch parts. Another added feature is the ability to print a white label that says “UNIT PASSED” or a giant red label that says the unit failed and which of the 8 tests failed were. I had to learn how to use delegates, as my serial event listener is on a separate thread and I can’t update labels, or parts of the User Interface without them. Still working on it, hopefully will wrap it up by Saint Patrick’s day.
|
I realize I haven’t updated in a while. I haven’t had much free time recently as I’ve been working on a project for my father in C# after work hours. This is a great change from only working in Python and JavaScript recently. I’m making a program that will analyze test results from a plasma torch for a company called HyperTherm. My father built the physical machine, but the employees want something that they can better see the results of a passed torch unit, or a failed torch unit. This program has a bar code scanner that scans the tool used in the test and matches it up to the lot of torch parts. Another added feature is the ability to print a white label that says “UNIT PASSED” or a giant red label that says the unit failed and which of the 8 tests failed were.I had to learn how to use delegates, as my serial event listener is on a separate thread and I can’t update labels, or parts of the User Interface without them. Still working on it, hopefully will wrap it up by Saint Patrick’s day.
|
||||||
|
|
||||||
|
|
||||||
I recently found a cool command in BASH that I hadn’t previously known. ``C-o`` will execute the current line, and then bring the following line up from BASH history. If you have a set of commands you want to execute again, rather than having to press up 20 times, hit enter, press up 19 times, hit enter, and so on… You can just hit up 20 times. Press C-o as many times as you need to.
|
I recently found a cool command in BASH that I hadn’t previously known. ``C-o`` will execute the current line, and then bring the following line up from BASH history. If you have a set of commands you want to execute again, rather than having to press up 20 times, hit enter, press up 19 times, hit enter, and so on… You can just hit up 20 times. Press C-o as many times as you need to.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
|
|
@ -47,15 +47,14 @@ Notice how it says your package is not in ``/usr/lib/python2.7/site-packages/``
|
||||||
Virtualenvwrapper
|
Virtualenvwrapper
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
After you create a virtual environment, you just run ``source bin/activate`` and it will activate the virtual environment. This can get tedious knowing exactly where your virtual environments are all the time, so some developers wrote some awesome scripts to fix that problem. This is called ``virtualenvwrapper`` and once you use it once, you will always want to use it more. What it does is that it has you create a hidden directory in your home directory, set that to an environment variable and references that directory as the basis for your virtual environments. The installation of this is pretty easy, you can ``pip install virtualenvwrapper`` if you want, or download the package and compile by hand.
|
After you create a virtual environment, you just run``source bin/activate`` and it will activate the virtual environment. This can get tedious knowing exactly where your virtual environments are all the time, so some developers wrote some awesome scripts to fix that problem. This is called``virtualenvwrapper`` and once you use it once, you will always want to use it more. What it does is that it has you create a hidden directory in your home directory, set that to an environment variable and references that directory as the basis for your virtual environments. The installation of this is pretty easy, you can``pip install virtualenvwrapper`` if you want, or download the package and compile by hand.
|
||||||
|
|
||||||
Once installed correctly, you can run the command ``mkvirtualenv envname`` to create a virtual environment. You can then run ``workon envname`` from anywhere, and it will activate that environment. For example, you could be at ``/var/www/vhosts/www.mysite.com/django/`` and run ``workon envname`` and it would activate the environment from there. This isn’t a required package (none of them are really…) as I went a couple years without using ``virtualenvwrapper``, but it is very useful and now I use it every day. Some tips I use with my setup of ``virtualenvwrapper`` is that I use the postactivate scripts to automatically try to change into the proper project directory of my environment. This also means I usually name my ``virtualenv`` after my project name for easy memory. It makes no sense to have a project called “cash_register” but the ``virtualenv`` be called “fez”. This is how I change to the right project after activating my ``virtualenv``. This goes in ``$WORKON_HOME/postactivate``
|
Once installed correctly, you can run the command ``mkvirtualenv envname`` to create a virtual environment. You can then run``workon envname`` from anywhere, and it will activate that environment. For example, you could be at``/var/www/vhosts/www.mysite.com/django/`` and run``workon envname`` and it would activate the environment from there. This isn’t a required package (none of them are really…) as I went a couple years without using``virtualenvwrapper``, but it is very useful and now I use it every day. Some tips I use with my setup of``virtualenvwrapper`` is that I use the postactivate scripts to automatically try to change into the proper project directory of my environment. This also means I usually name my``virtualenv`` after my project name for easy memory. It makes no sense to have a project called “cash_register” but the``virtualenv`` be called “fez”. This is how I change to the right project after activating my ``virtualenv``. This goes in ``$WORKON_HOME/postactivate``
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# This hook is run after every virtualenv is activated.
|
# This hook is run after every virtualenv is activated.
|
||||||
|
|
||||||
# if its a work or a personal project (Example)
|
# if its a work or a personal project (Example)
|
||||||
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
|
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
|
||||||
if [[ -e "/Users/tsouza/PersonalProjects/$proj_name" ]]
|
if [[ -e "/Users/tsouza/PersonalProjects/$proj_name" ]]
|
||||||
|
|
|
@ -17,7 +17,6 @@ Our solution is to prefetch for any M2M that are related to the current Model.
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
|
|
||||||
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
||||||
if db_field.__class__.__name__ == "ManyToManyField" and \
|
if db_field.__class__.__name__ == "ManyToManyField" and \
|
||||||
db_field.rel.to.__name__ == self.model.__name__:
|
db_field.rel.to.__name__ == self.model.__name__:
|
||||||
|
|
|
@ -9,13 +9,13 @@ How to not trigger a post_save in Django, but still modify data.
|
||||||
|
|
||||||
Recently I have been diving into using signals with Django, which of course are pretty neat.
|
Recently I have been diving into using signals with Django, which of course are pretty neat.
|
||||||
|
|
||||||
I am working on a website for work which in the most basic explanation, is a task management site. Recently I have added in the ability to subscribe to tasks and get emails, I did this by connecting to the post_save signal. I only email out when a task is changed, not created (of course, no one would be subscribed to it). This worked flawlessly and “emails” out to anyone who is subscribed. I say that in quotes, because I haven’t actually hooked it up to a real SMTP server, and only use
|
I am working on a website for work which in the most basicexplanation, is a task management site. Recently I have added in the ability to subscribe to tasks and get emails, I did this by connecting to the post_save signal. I only email out when a task is changed, not created (of course, no one would be subscribed to it). This worked flawlessly and “emails” out to anyone who is subscribed. I say that in quotes, because I haven’t actually hooked it up to a real SMTP server, and only use
|
||||||
|
|
||||||
.. code:: console
|
.. code:: shell
|
||||||
|
|
||||||
python -m smtpd -n -c DebuggingServer localhost:1025
|
python -m smtpd -n -c DebuggingServer localhost:1025
|
||||||
|
|
||||||
which will output any emails to stdout. But I digress… A problem arose when I was working on ordering tasks.
|
which will output any emails to stdout. But I digress… A problem arose when I was working on ordering tasks.
|
||||||
|
|
||||||
I store an integer in the “ordering” column, which any authenticated user can drag the row to a new location and that will reorder the task. I did this after I setup the emailing signal, so I didn’t think about an email being sent out for EVERY task being changed.
|
I store an integer in the “ordering” column, which any authenticated user can drag the row to a new location and that will reorder the task. I did this after I setup the emailing signal, so I didn’t think about an email being sent out for EVERY task being changed.
|
||||||
|
|
||||||
|
@ -25,12 +25,12 @@ You can do this by doing something like this:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
from app.models import ModelName
|
from app.models import ModelName
|
||||||
|
|
||||||
def reorder(request):
|
def reorder(request):
|
||||||
new_order = request.POST.get('new_order',None)
|
new_order = request.POST.get('new_order', None)
|
||||||
pk = request.POST.get('modelname_pk',None)
|
pk = request.POST.get('modelname_pk', None)
|
||||||
if new_order:
|
if new_order:
|
||||||
ModelName.objects.filter(pk=pk).update(ordering=new_order)
|
ModelName.objects.filter(pk=pk).update(ordering=new_order)
|
||||||
|
|
||||||
I am not sure if this is the proper way save changes and not trigger a post_save signal, but this is the way that worked for me so I figured I would document this.
|
I am not sure if this is the proper way save changes and not trigger a post_save signal, but this is the way that worked for me so I figured I would document this.
|
||||||
|
|
|
@ -9,7 +9,7 @@ SSH Agent on “boot”
|
||||||
|
|
||||||
I had a friend complain that he had to keep adding his ssh key to his ssh-agent every time he rebooted. I have a really easy bit of shell code you can put into your .bashrc or your .zshrc file:
|
I had a friend complain that he had to keep adding his ssh key to his ssh-agent every time he rebooted. I have a really easy bit of shell code you can put into your .bashrc or your .zshrc file:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code:: bash
|
||||||
|
|
||||||
SSHKEYFILE=/path/to/your/ssh/key/file
|
SSHKEYFILE=/path/to/your/ssh/key/file
|
||||||
ssh-add -l | grep -q $SSHKEYFILE
|
ssh-add -l | grep -q $SSHKEYFILE
|
||||||
|
|
|
@ -53,28 +53,39 @@ article ul {
|
||||||
.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;}
|
.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;}
|
||||||
.dquo {margin-left:-.38em;}
|
.dquo {margin-left:-.38em;}
|
||||||
|
|
||||||
|
|
||||||
.parent-panel { padding-left:20%;width:100%; }
|
|
||||||
.right-panel { position:relative;float:left;width:100%; }
|
|
||||||
.right-panel-content {
|
.right-panel-content {
|
||||||
max-width: 60%;
|
|
||||||
border-left: 2px dashed #b58900;
|
border-left: 2px dashed #b58900;
|
||||||
min-height: 96vh;
|
min-height: 96vh;
|
||||||
padding-left: 0.75rem;
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 700px) {
|
||||||
|
.parent-panel { padding-left:20%;width:100%; }
|
||||||
|
.right-panel { position:relative;float:left;width:100%; }
|
||||||
|
|
||||||
|
.right-panel-content {
|
||||||
|
max-width: 60%;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
}
|
||||||
|
.left-panel {
|
||||||
|
position:relative;
|
||||||
|
float:left;
|
||||||
|
width:20%;
|
||||||
|
right:20%;
|
||||||
|
margin-left:-101%;
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 700px) {
|
||||||
|
.left-panel {
|
||||||
|
border: 2px dashed #b58900;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-panel-content img {
|
.right-panel-content img {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
max-width: 50rem;
|
max-width: 50rem;
|
||||||
}
|
}
|
||||||
.left-panel {
|
|
||||||
position:relative;
|
|
||||||
float:left;
|
|
||||||
width:20%;
|
|
||||||
right:20%;
|
|
||||||
margin-left:-101%;
|
|
||||||
text-align:right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small {
|
.small {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
|
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="generator" content="Pelican" />
|
<meta name="generator" content="Pelican" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
{% if FEED_ALL_ATOM %}
|
{% if FEED_ALL_ATOM %}
|
||||||
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
|
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user