- KK MK X525 V3 QuadCopter Folding Frame Friber Glass MultiCoptor Frame × 1
- RC Hobbies 2600KV Outrunner Brushless Motor × 4
- 20A Electric Speed Controller RC ESC BEC × 4
- TURNIGY 2200mah 3s 20c 30c 11.1v Lipo battery × 1
- 10 X 4.5 1045 / 1045R CW CCW Counter Rotating Propellers × 3 pairs (one pair for spare)
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 passport = require('passport'); | |
var BearerStrategy = require('passport-http-bearer').Strategy; | |
var Posts = function () { | |
var strategy = new BearerStrategy({ session: false }, function ( token, done ) { | |
if (token == '1234567890') { | |
return done(null, {username: "someuser"}); | |
} | |
return done(null); |
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
# stash unstaged changes so they are not included in the tests | |
git stash -q --keep-index | |
npm test | |
RESULT=$? | |
# put the unstaged changes back | |
git stash pop -q | |
[ $RESULT -ne 0 ] && exit 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
<?php | |
function createMVCRoute($defaults) | |
{ | |
$application = \Slim\Slim::getInstance(); | |
return function () use ($application, $defaults) | |
{ | |
$controllerClass = $defaults['controller']; | |
$defaultAction = isset($defaults['action']) ? $defaults['action'] : 'index'; | |
$args = func_get_args(); |
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
on run | |
tell application "Finder" | |
if selection is {} then | |
set finderSelection to quoted form of POSIX path of (folder of the front window as string) | |
else | |
set sel to (first item of (selection as list)) | |
if class of sel is folder then | |
set finderSelection to quoted form of POSIX path of (sel as string) | |
else | |
set finderSelection to quoted form of POSIX path of ((container of sel) as string) |
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 | |
function is_serialized($input) | |
{ | |
return is_string($value) && preg_match("/^(O|R|N|a|s|i|b|d):\d+/", $value); | |
} |
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(serverRequestEvent); | |
server.listen(8080, serverListeningEvent); | |
function serverRequestEvent(request, response) { | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
response.write('Hello World'); | |
response.end(); |
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 path = Url.parse(request.url).path; | |
router.route(path) | |
.then(dispatchRoute) | |
.then(handleResponse) | |
.fail(handleError) // handle application errors | |
.fail(handleServerError); // catch all others |
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 Q = require('q'); | |
var step1 = Q.promise(function (resolve, reject) { reject('an error on 1'); }); // <-- reject here | |
var step2 = Q.promise(function (resolve, reject) { resolve(2); }); | |
var step3 = Q.promise(function (resolve, reject) { resolve(3); }); | |
var step4 = Q.promise(function (resolve, reject) { resolve(4); }); | |
step1.then(function (value) { | |
console.log(value); | |
return step2; |
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 | |
$file_src = 'file.gif'; | |
$im = new Imagick($file_src); | |
$format = $im->getImageFormat(); | |
if ($format != 'GIF') { | |
// reject | |
} |