Skip to content

Instantly share code, notes, and snippets.

View danopia's full-sized avatar

Daniel Lamando danopia

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@visnup
visnup / README.js
Created November 15, 2010 21:36 — forked from igrigorik/webapp.rb
node.js version inspired by igrigorik's any ruby object, as a webapp! 'cause we can too.
#!/usr/bin/env node
var http = require('http')
, webapp = require('webapp');
http.createServer(webapp.bind([])).listen(8000);
// ^^^^^^^^^^^^^^^
// | (x)
// ROFLSCALE DEQUE ---/
@hashmal
hashmal / gist:874792
Created March 17, 2011 17:54
[Lua] Print table contents recursively
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
@danopia
danopia / screenshot.rb
Created April 8, 2011 20:46
Takes a screenshot and uploads it to a remote SSH server, showing a notify-osd progress bar and optionally putting a URL on the GTK clipboard.
#!/usr/bin/env ruby
require 'fileutils'
require 'pathname'
require 'uri'
require 'rubygems'
require 'RNotify'
require 'net/ssh'
require 'net/scp'
GrusersModules : save : [ user_id,
gallery_id,
'button', --this is unknown
{ submission_type: unknown,
submission_id: unknown,
submission_folderid: unknown }]
GrusersModules : addModuleCommit : [ user_id,
page_id,
module_id ] --idk
Mood : getMoodsFlattened : [ no params ]
Comments : getArtistComment : [ dev_id ] -- deviantion id
Comments : getThread : [ 1, -- no idea
dev_id,
50 ]
Comments : getBodies : [ comment_id,
typeid,
Points : modal : [ username ] -- or ''
Points : transferModal : [ username,
number_of_points,
memo,
user_password,
tos ] -- ???
Points : morePointsModal : []
@friggeri
friggeri / haiku
Created October 6, 2011 07:30
random heroku-like name generator
haiku = ->
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
@THEtheChad
THEtheChad / parseColor.js
Created October 19, 2011 06:17
Super compact javascript color parsing function
/**!
* @preserve $.parseColor
* Copyright 2011 THEtheChad Elliott
* Released under the MIT and GPL licenses.
*/
// Parse hex/rgb{a} color syntax.
// @input string
// @returns array [r,g,b{,o}]
@dave1010
dave1010 / htaccess
Created December 14, 2011 13:07
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config created by @dave1010
# Licensed CC BY 2.0
# Images CC BY 2.0, from GirlieMac's photostream:
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/
# Usage: copy save this file as .htaccess or add it to your httpd.conf
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>'