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
location / { | |
if ($uri ~* ^/([^.\?/]+)) { | |
set $foldername "$1"; | |
} | |
sub_filter "<head>" "<head><base href=\"${scheme}://${host}/${foldername}/\">"; | |
} |
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
{ | |
"Mississippi": [30.1477890014648, 34.9960556030273, -91.6550140380859, -88.0980072021484], | |
"Oklahoma": [33.6191940307617, 37.0021362304688, -103.002571105957, -94.4312133789062], | |
"Delaware": [38.4511260986328, 39.8394355773926, -75.7890472412109, -74.9846343994141], | |
"Minnesota": [43.4994277954102, 49.3844909667969, -97.2392654418945, -89.4833831787109], | |
"Illinois": [36.9701309204102, 42.5083045959473, -91.513053894043, -87.0199203491211], | |
"Arkansas": [33.0041046142578, 36.4996032714844, -94.6178131103516, -89.6422424316406], | |
"New Mexico": [31.3323001861572, 37.0001411437988, -109.050178527832, -103.000862121582], | |
"Indiana": [37.7717399597168, 41.7613716125488, -88.0997085571289, -84.7845764160156], | |
"Louisiana": [28.9210300445557, 33.019458770752, -94.0431518554688, -88.817008972168], |
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
# Basic text search with relevancy for MongoDB. | |
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/ | |
# Copythingie 2010 - Ward Bekker - ward@tty.nl | |
#create (or empty) a docs collection | |
doc_col = MongoMapper.connection.db('example_db').collection('docs') | |
doc_col.remove({}) | |
#add some sample data | |
doc_col.insert({ "txt" => "it is what it is"}) |
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
// Kosso imageAsCropped | |
// added to TiBlob.m | |
// requires 4 arguments : x, y, width, height | |
- (id)imageAsCropped:(id)args | |
{ | |
[self ensureImageLoaded]; | |
if (image!=nil) | |
{ | |
ENSURE_ARG_COUNT(args,4); |
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
// modified version of https://github.com/pangratz/dnd-file-upload by pangratz | |
// modified by : kosso | |
// date : 06 November 2010 | |
// added some options for: | |
// allowMultiple | |
// allowedExtensions | |
// maximumFileSize | |
// also added dragEnter and dragLeave functions to enable change of appearance of the dropzone |
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
require.paths.unshift('/usr/local/lib/node/socket.io/lib/socket.io/transports'); | |
var htmlfile = require('htmlfile') | |
, flashsocket = require('flashsocket') | |
, jsonppolling = require('jsonp-polling') | |
, websocket = require('websocket') | |
, xhrmultipart = require('xhr-multipart') | |
, xhrpolling = require('xhr-polling'); | |
var http = require('http') | |
, io = require('socket.io'); |
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 http = require('http') | |
, parse = require('url').parse | |
, StringDecoder = require('string_decoder').StringDecoder; | |
var LIMIT = 10 * 1024; | |
var request = function(url, body, func) { | |
if (typeof url !== 'object') { | |
url = parse(url); | |
} |
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
TAFFY.extend( 'capped', function( i, runInsert, runRemove ) { | |
var c = this.getDBI().cap || false; | |
if( c && ( c < ( this.count() + 1 ) ) ) { | |
while( c < ( this.count() + 1 ) ) { | |
this.getDBI().remove( this.context().results[0].___id ); | |
this.context({ | |
run: null | |
}); | |
this.getDBI().removeCommit( runRemove ); | |
} |
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 | |
/** | |
* Base Model | |
* | |
* @package Extends Model Laravel | |
* @version 1.0 | |
* @author Purwandi <free6300@gmail.com> | |
* @link http://purwand.me | |
*/ | |
class Base extends Eloquent{ |
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 | |
require 'vendor/autoload.php'; | |
$loop = new React\EventLoop\StreamSelectLoop(); | |
$app = function ($request, $response) use ($loop) { | |
$response->writeHead(200, []); | |
$fh = fopen('http://localhost/', 'r'); |
OlderNewer