This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Examples of crud operations on node.js using node-mongodb-native (in coffeescript) | |
mongo = require("mongodb") | |
host = 'localhost' | |
port = mongo.Connection.DEFAULT_PORT | |
this.ObjectID = mongo.ObjectID | |
this.db = new mongo.Db 'mydb', new mongo.Server(host, port, {}), {} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script> | |
/*! | |
* jQuery JavaScript Library v1.4.2 | |
* http://jquery.com/ | |
* | |
* Copyright 2010, John Resig | |
* Dual licensed under the MIT or GPL Version 2 licenses. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drew LeSueur @drewlesueur | |
# An abstraction for calling multiple asynchronous | |
# functions at once, and calling a callback | |
# with the "return values" of all functions | |
# when they are all done. | |
# requires underscore.js | |
_.mixin # underscore.js mixin | |
do_these: (to_dos, callback) -> | |
return_values = if _.isArray(to_dos) then [] else {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call pathogen#runtime_append_all_bundles() | |
filetype plugin indent on | |
set backspace=indent,eol,start | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
"colorscheme jellybeans | |
ino jj <esc> | |
cno jj <c-c> | |
vno v <esc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#allows you to have infinite subdomains | |
<VirtualHost *:80> | |
# first do a2enmod vhost_alias | |
ServerName anything.the.tl | |
ServerAlias *.the.tl | |
UseCanonicalName Off | |
VirtualDocumentRoot /root/workspace/sites/%0 # %0 is the full domain name | |
</VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#hook up node.js with apache so you can have an apache site on port 80 | |
# and a node.js server running on port 80 | |
# you may need to `a2enmod proxy` and `a2enmod proxy_http` | |
<VirtualHost *:80> | |
ServerName severus.the.tl | |
ProxyPass / http://127.0.0.1:86/ | |
# CustomLog /var/log/apache2/lazeroids-node-access.log combined | |
# ErrorLog /var/log/apache2/lazeroids-node-error.log | |
# NoCache * | |
<Proxy *> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person = () -> | |
name = "Fred" | |
ret = | |
getName: () -> | |
return name | |
setName: (newName) -> | |
name = newName | |
bob = person() | |
alert bob.getName() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function csv_to_array($csv) { | |
if (substr($csv,-1) != "\n" && substr($csv,-1) != "\r") { | |
$csv .= "\n"; | |
} | |
$len = strlen($csv); | |
$table = array(); | |
$cur_row = array(); | |
$cur_val = ""; | |
$state = "first item"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function resize_image($image, $w, $h) { | |
$ret = imagecreatetruecolor($w, $h); | |
imagealphablending( $ret, false ); | |
imagesavealpha( $ret, true ); | |
imagecopyresampled($ret, $image, 0, 0, 0, 0, $w, $h, imagesx($image), imagesy($image)); | |
//imageantialias($ret,true); | |
return $ret; | |
} | |
public static function overlay_image($image, $overlay, $x, $y) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="pics/IMG_1255.jpg" width="300"><br> | |
<img src="pics/IMG_1256.jpg" width="300"><br> | |
<img src="pics/IMG_1257.jpg" width="300"><br> | |
<img src="pics/IMG_1258.jpg" width="300"><br> | |
<img src="pics/IMG_1259.jpg" width="300"><br> |