Skip to content

Instantly share code, notes, and snippets.

View elliotttf's full-sized avatar

Elliott Foster elliotttf

View GitHub Profile
define({
// Student port should match the randomly assigned port
// for this user that the node application is listening on.
url: 'http://STUDENT.nodejs.4kclass.com:STUDENT_PORT'
});
@elliotttf
elliotttf / config.js
Created May 15, 2013 12:13
Example config file for Four Kitchens node.js training.
module.exports = {
port: 1234, // Unique port number.
pollInterval: 10000, // Frequency that content endpoints will be polled at.
drupalNodesUrl: 'http://user.training-server.com/exercises/drupal/rest/node.json' // URL to student's training instance.
};
<?php
$strs = array(
'modules/system/system.menus.css',
'modules/system/system.css',
);
$re = '/^(modules\/system\/((?!system\.menus).+)\.css)$/';
foreach ($strs as $str) {
print_r(preg_match($re, $str) ? 'Yay' : 'Boo');
print PHP_EOL;
}
@elliotttf
elliotttf / bookmarklet.js
Last active December 13, 2015 18:19
Pro-domme bookmarklet for the lulz.
/**
* Made with ♥ by Elliott Foster
* @elliotttf
*/
var go = (function(window, document) {
function replacer(match, p1, p2, p3, offset, string) {
var ret = p1 + p2.charAt(0).toUpperCase() + p2.slice(1) + p3;
return ret;
}
--- desktop.html 2013-02-07 13:49:37.000000000 -0600
+++ mobile.html 2013-02-07 13:48:44.000000000 -0600
@@ -1,12 +1,12 @@
<picture data-alt="Can't wait for this breakfast.">
<!-- <source src="http://fullplateliving.org/sites/default/files/styles/super__mobile/public/recipes/banner_images/20121023-dsc_3523.jpg" width="480" height="162"> -->
<source src="http://fullplateliving.org/sites/default/files/styles/super__mobile/public/recipes/banner_images/20121023-dsc_3523.jpg" width="480" height="162">
<!-- <source src="http://fullplateliving.org/sites/default/files/styles/super__mobile/public/recipes/banner_images/20121023-dsc_3523.jpg" media="(min-width: 320px)"> -->
<source src="http://fullplateliving.org/sites/default/files/styles/super__mobile/public/recipes/banner_images/20121023-dsc_3523.jpg" media="(min-width: 320px)">
<!-- <source src="http://fullplateliving.org/sites/default/files/styles/super__full/public/recipes/banner_images/20121023-dsc_3523.jpg" media="(min-width: 768px)"> -->
<so
app.router.post('/', function() {
var loopString = '';
this.req.chunks.forEach(function(chunk) {
loopString += chunk;
});
if (this.req.chunks.toString() !== loopString) {
this.res.end('WAT?');
return;
}
this.res.end('yay');
diff --git a/app.js b/app.js
index 6009506..6f050ff 100644
--- a/app.js
+++ b/app.js
@@ -4,32 +4,25 @@
*/
var express = require('express')
- , routes = require('./routes')
- , user = require('./routes/user')
var out = 'Hello' + false ? 'WAT.' : 'world.';
(function($) {
if (!$('#selector').hasClass('active')) {
// Do thangs.
}
}(jQuery));
{
"name": "hosted-hubot",
"version": "2.1.4",
"author": "GitHub Inc.",
"keywords": "github hubot campfire bot",
"description": "A simple helpful Robot for your Company",
"licenses": [{
"type": "MIT",
"url": "http://github.com/github/hubot/raw/master/LICENSE"
}],