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
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
#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
<?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 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> | |
</head> | |
<body style="width:1000px; height: 1000px;"> | |
<h1>Drop</h1> | |
<script> |
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
/* | |
smtpd.js is SMTP server written for node.js | |
MIT License | |
*/ | |
var tcp = require('tcp'); | |
var sys = require('sys'); |
NewerOlder