I hereby claim:
- I am gabamnml on github.
- I am aramburu (https://keybase.io/aramburu) on keybase.
- I have a public key whose fingerprint is BEE6 5C9B 7555 0DCF 90EF 283F 63CB 06F8 A598 BA42
To claim this, I am signing this object:
# useful for running ssl server on localhost | |
# which in turn is useful for working with WebSocket Secure (wss) | |
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/ |
To change a field name in django 1.7+ | |
1. Edit the field name in the model (but remember the old field name: you need it for step 3!) | |
2. Create an empty migration | |
$ python manage.py makemigrations --empty myApp | |
3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding | |
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'), | |
to the operations list. |
I hereby claim:
To claim this, I am signing this object:
Capitán América: Civil War – 6 de mayo el año 2016 | |
Doctor Extraño – 4 de noviembre el año 2016 | |
Guardianes de la Galaxia, vol. 2 – 5 de mayo de, 2017 | |
Spider-Man: Homecoming – 7 julio 2017 | |
Thor: Ragnarok – 3 noviembre 2017 |
What this guide will cover: the code you will need in order to include Redis and Resque in your Rails app, and the process of creating a background job with Resque.
What this guide will not cover: installing Ruby, Rails, or Redis.
Note: As of this writing I am still using Ruby 1.9.3p374, Rails 3.2.13, Redis 2.6.11, and Resque 1.24.1. I use SQLite in development and Postgres in production.
Background jobs are frustrating if you've never dealt with them before. Over the past few weeks I've had to incorporate Redis and Resque into my projects in various ways and every bit of progress I made was very painful. There are many 'gotchas' when it comes to background workers, and documentation tends to be outdated or scattered at best.
local usbWatcher = nil | |
function usbDeviceCallback(data) | |
if (data["productName"] == "USB Keyboard") then | |
if (data["eventType"] == "added") then | |
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 1') | |
elseif (data["eventType"] == "removed") then | |
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 0') | |
end | |
end |
Thanks to this article by Christoph Berg
Directories and files
~/
var pushRight = slate.operation("push", { | |
"direction": "right", | |
"style": "bar-resize:screenSizeX/2" | |
}); | |
var pushLeft = slate.operation("push", { | |
"direction": "left", | |
"style": "bar-resize:screenSizeX/2" | |
}); |