Skip to content

Instantly share code, notes, and snippets.

var Entry = (function($) {
function Entry(attributes) {
this.attributes = attributes;
}
Entry.prototype.get = function(attr) {
return this.attributes[ attr ] || null;

Keybase proof

I hereby claim:

  • I am jimrubenstein on github.
  • I am jrub (https://keybase.io/jrub) on keybase.
  • I have a public key whose fingerprint is 9A3E 223C B262 4C98 8EA3 2592 E80D ADCA E737 323D

To claim this, I am signing this object:

$generateKpiValue = function($metric_info) {
$words = explode('_', $metric_info['uid']);
array_shift($words);
return implode('', array_map('ucfirst', $words));
};
@jimrubenstein
jimrubenstein / .htaccess
Created July 28, 2014 17:48
Dynamic sub-domain -> sub-folder webroot rewriting (more documentatino here: http://stackoverflow.com/a/17890602/109026)
# goes in folder that holds symlinks to project files (/home/jim/sites/dev)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+)\.local.dev
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/
RewriteRule ^(.*)$ /%1/$1 [L]
RewriteCond %{HTTP_HOST} ^([^.]+)\.dev\.local
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/
RewriteRule ^(.*)$ /%1/$1 [L]
<?php
function findObjectById($objects, $id)
{
foreach ($objects as $obj)
{
if ($obj->programId == $id)
{
return $obj;
}
@jimrubenstein
jimrubenstein / gist:46ac06e3c6ab1f589419
Created September 5, 2014 18:33
arizona zip codes
zip_code,city,state
84536,Monument Valley,Arizona
85001,Phoenix,Arizona
85002,Phoenix,Arizona
85003,Phoenix,Arizona
85004,Phoenix,Arizona
85005,Phoenix,Arizona
85006,Phoenix,Arizona
85007,Phoenix,Arizona
85008,Phoenix,Arizona
function createOption($listItem, $input)
{
$listItem.on('click tap', function(evt)
{
$input.prop('checked', ! $input.prop('checked'));
if ($input.is(':checked'))
{
$listItem.addClass('selected');
var React= require('react/addons');
var Router = require('react-router');
var AppConstants = require('../../constants/AppConstants');
var GroupActionCreators = require('../../actions/GroupActionCreators');
var Link = Router.Link;
module.exports = React.createClass({
mixins: [Router.Navigation],
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"app\\": "app/"
},
"files": [
"app/helpers/helpers.php"
]
$ mysql -e 'show slave status \G' -u root | grep "Running: No"
$ echo $?
1
$ mysql -e 'show slave status \G' -u root | grep "Running"
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
$ echo $?
0