From | To | Expression |
---|
¯\_(ツ)_/¯ | |
┌( ಠ_ಠ)┘ | |
{ಠಠ}_,,|, | |
ಥ_ಥ | |
(///_ಥ) | |
๏̯͡๏ | |
טּ_טּ | |
◪_◪ | |
◮_◮ | |
◔_◔ |
//To change the way (below) is displayed | |
$display("%t", $realtime); | |
//$timeformat(unit#, prec#, "unit", minwidth); | |
$timeformat(-3, 2, " ms", 10); // -3 and " ms" give useful display msg | |
unit is the base that time is to be displayed in, from 0 to -15 | |
precision is the number of decimal points to display. | |
"unit" is a string appended to the time, such as " ns". | |
minwidth is the minimum number of characters that will be displayed. |
virtualenv --no-site-packages hodor | |
hodor/bin/pip install simplejson ujson cbor tnetstring msgpack-python | |
curl -s 'http://www.json-generator.com/api/json/get/cvfsLVmKiG?indent=2' > test.json | |
hodor/bin/python shootout.py |
#!/usr/bin/env python | |
import RPi.GPIO as gpio | |
from time import sleep | |
import re | |
import sys | |
gpio.setmode(gpio.BCM) | |
red = 23 | |
yel = 24 |
def clear_data(session): | |
meta = db.metadata | |
for table in reversed(meta.sorted_tables): | |
print 'Clear table %s' % table | |
session.execute(table.delete()) | |
session.commit() |
(Note: This was originally from my blog post on AlexanderRobotics.com, but I brought that site down and wanted to keep this post alive since it's referenced by Stack Overflow).
The beauty of the Arduino lies in its simplicity. A look under the covers of the Arduino and its IDE, however, reveals a fascinating chipset and an open, extensive toolchain.
# First, Install Vagrant and Virtualbox then: | |
# Create new project directory | |
mkdir -p ~/Sites/newproject # Create new project directory | |
mk ~/Sites/newproject # Go into your new project directory | |
# Setup Vagrant | |
vagrant init | |
# Edit vagrant file box and box url to install Ubuntu, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L6-L8 | |
# Edit Vagrantfile to create a static IP address, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L10 |
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions |
Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
by Sander Marechal
I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.