Skip to content

Instantly share code, notes, and snippets.

@enliven-
enliven- / gist:5502660
Created May 2, 2013 14:40
nodejs app deploy fail
➜ signalmaster git:(master) ✗ jitsu deploy
info: Welcome to Nodejitsu viksit
info: jitsu v0.12.10-2, node v0.10.5
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node server.js
info: Creating snapshot 0.0.1-1
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
{
"name": "signal-master",
"version": "0.0.1-1",
"repository": {
"type": "git",
"url": "[email protected]:andyet/signal-master.git"
},
"description": "Mind-meldification for teams",
"dependencies": {
"async": "0.1.9",
@enliven-
enliven- / zsh.md
Created February 4, 2014 09:16 — forked from tsabat/zsh.md
Source: http://jakeaustwick.me/python-web-scraping-resource/
Jake Austwick
09 Mar 2014 on requests | python | lxml | scrape | proxies | web crawler | download images
Python web scraping resource
If you need to extract data from a web page, then the chances are you looked for their API. Unfortunately this isn't always available and you sometimes have to fall back to web scraping.
In this article I'm going to cover a lot of the things that apply to all web scraping projects and how to overcome some common gotchas.
Please Note: This is a work in progress. I am adding more things as I come across them. Got a suggestion? Drop me an email - [email protected]
@enliven-
enliven- / xulrunner.sh
Created May 12, 2014 09:51
downloads appropriate xulrunner and installs it on ubuntu
FIREFOX_VERSION=`grep -Po "\d{2}\.\d+" /usr/lib/firefox/platform.ini`
ARCH=`uname -p`
XURL=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$FIREFOX_VERSION/runtimes/xulrunner-$FIREFOX_VERSION.en-US.linux-$ARCH.tar.bz2
cd /opt
sudo sh -c "wget -O- $XURL | tar -xj"
sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner
@enliven-
enliven- / git log
Created June 1, 2014 03:15
pretty print git log
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
--pretty="..." defines the format of the output.
%h is the abbreviated hash of the commit
%d are any decorations on that commit (e.g. branch heads or tags)
%ad is the author date
%s is the comment
%an is the author name
--graph informs git to display the commit tree in an ASCII graph layout
--date=short keeps the date format nice and short
/*
If you try to print a gitbook directly, you get nothing but the contents because of their *just* use of `@media print` styling to hide away the content section of the books.
Fret not, here is the codez:
*/
$(".book-header,.book-summary,.navigation,.book-progress").remove();
$(".book.with-summary .book-body").css('left', '0px');
$("*").css('position', 'static');
window.print()
@enliven-
enliven- / sublimeshortcuts
Created June 30, 2014 06:04
sublime keyboard shortcuts
Editing
Windows
Ctrl + Alt + Up Column selection up
Ctrl + Alt + Down Column selection down
Linux
Alt + ⇧ + Up Column selection up
Alt + ⇧ + Down Column selection down
Navigation/Goto Anywhere
Keypress Command
@enliven-
enliven- / ajax_prefilter_and_jq_serialize
Created July 1, 2014 10:17
snippets from so + backbone tut for a ajax prefilter and a fn to serialize jq object
$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
options.url = 'http://backbonejs-beginner.herokuapp.com' + options.url;
});
$.fn.serializeObject = function() {
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {