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'); | |
var server = http.createServer(function(req, res) { | |
// console.log(req); // debug dump the request | |
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
console.log("Authorization Header is: ", auth); |
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 | |
return Response::json(new SettingTemplate($data)); |
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 | |
class SomeClass | |
{ | |
/** | |
* Hold options data for later use. | |
* | |
* @var Array | |
*/ |
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
/** | |
* Module dependencies. | |
*/ | |
var async = require('async') | |
, countryTemplate = require('./country') | |
, _ = require('underscore'); | |
function aname(models, model, options, callback) { | |
if ( ! _.isObject(model)) { | |
if (typeof callback != 'undefined') { |
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
#!/usr/bin/python | |
import os | |
import sys | |
from dropbox.client import DropboxClient | |
# get an access token, local (from) directory, and Dropbox (to) directory | |
# from the command-line | |
access_token, local_directory, dropbox_destination = sys.argv[1: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
<?php | |
use Symfony\Component\Translation\Translator as SymfonyTranslator; | |
use Symfony\Component\Translation\MessageSelector; | |
use Symfony\Component\Translation\Loader\PhpFileLoader; | |
class Translator | |
{ | |
/** |
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 | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4211 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
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 | |
/* | |
DrUUID RFC4122 library for PHP5 | |
by J. King (http://jkingweb.ca/) | |
Licensed under MIT license | |
See http://jkingweb.ca/code/php/lib.uuid/ | |
for documentation | |
Last revised 2011-03-20 |
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
from tkinter import * | |
import random | |
import time | |
class Ball: | |
def __init__(self, canvas, paddle, color): | |
self.canvas = canvas | |
self.paddle = paddle | |
self.id = canvas.create_oval(10, 10, 25, 25, fill=color) |
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 | |
namespace Assetic\Filter; | |
use Assetic\Asset\AssetInterface; | |
use Assetic\Util\ProcessBuilder; | |
/** | |
* Runs assets through gzip. | |
*/ |
OlderNewer