This file contains 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
/* | |
smtpd.js is SMTP server written for node.js | |
MIT License | |
*/ | |
var tcp = require('tcp'); | |
var sys = require('sys'); |
This file contains 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> | |
</head> | |
<body style="width:1000px; height: 1000px;"> | |
<h1>Drop</h1> | |
<script> |
This file contains 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
<?php | |
//Use this script to automatically log into a site and grab protected info. | |
//code modified from | |
// http://www.knowledgesutra.com/forums/topic/38162-automatic-login-using-curl/ | |
//see also | |
//http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ | |
// INIT CURL | |
$ch = curl_init(); | |
//needed for https | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); |
This file contains 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 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 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 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
var adjacencyOperators = { | |
append: 'beforeEnd', | |
prepend: 'afterBegin', | |
before: 'beforeBegin', | |
after: 'afterEnd' | |
}; | |
for (key in adjacencyOperators) | |
$.fn[key] = (function(operator) { | |
return function(html){ |
This file contains 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
define (require, exports, module) -> | |
_ = require("underscore") | |
_.mixin require("underscore.string") | |
_.mixin | |
# Converts the arguments list to an Array | |
aToArr: (list) -> | |
if _.isArguments(list) | |
_.toArray(list).slice(0) | |
else |
This file contains 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
The Error: | |
element["insertAdjacent" + (html instanceof Element ? "Element" : "HTML")] is not a function | |
http://localhost:8080/scripts/zepto.js | |
Line 145 | |
the zepto.js is 5ecaa (HEAD of the zepto repo) | |
backbone.js is 261059 (HEAD of backbone's repo) | |
the stack looks like.. |
This file contains 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
/** | |
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left, | |
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view. | |
*/ | |
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/; |
OlderNewer