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
NoMethodError: undefined method `key?' for #<JSON::Ext::Generator::State:0x000000c183cf40> from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/core_ext/object/try.rb:36:in `try' from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activemodel-3.2.11/lib/active_model/serializers/json.rb:91:in `as_json' from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/json/encoding.rb:47:in `block in encode' from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/json/encoding.rb:77:in `check_for_circular_references' from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/json/encoding.rb:46:in `encode' from /home/ec2-user/.rbenv/versions/ruby-1.9.3-p326/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_su |
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 request = require('request') | |
, list = [] | |
, results = {} | |
, counter = list.length; | |
list.forEach(function(v, i) { | |
request.get({url: 'https://graph.facebook.com/'+v, json: true}, function(err, response, body) { | |
if (err) { | |
results[i] = 'error'; | |
counter--; |
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
walkPath = (path) -> | |
fs.stat path, (err, stats) -> | |
throw err if err? | |
if stats.isDirectory() | |
fs.readdir path, (err, contents) -> | |
throw err if err? | |
for file in contents | |
walkPath "#{path}/#{file}" | |
else if stats.isFile() | |
if path.match /\S+\.coffee$/ |
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.exports = function helloWorld() { | |
console.log('Hello world!'); | |
} | |
function doSomeStuff() { | |
console.log('I did stuff'); | |
} | |
function doMoreStuff() { | |
console.log('I did more stuff'); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void printGroups(gid_t *, size_t); | |
int main(int argc, char **argv) { | |
gid_t *groupList; | |
int ngroups = sysconf(_SC_NGROUPS_MAX); |
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 exec = require('child_process').exec; | |
function displayOutput(err, stdout, stderr) { | |
if (err) | |
return; | |
console.log(stdout); | |
} | |
if (process.getuid() === 0) { |
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 exec = require('child_process').exec; | |
function displayOutput(err, stdout, stderr) { | |
if (err) | |
return; | |
console.log(stdout); | |
} | |
if (process.getuid() === 0) { |
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 NativeModule; | |
/* Hack to get a reference to node's internal NativeModule */ | |
(function(){ | |
// intercept NativeModule.require's call to process.moduleLoadList.push | |
process.moduleLoadList.push = function(){ | |
// `NativeModule.require('native_module')` returns NativeModule | |
NativeModule = arguments.callee.caller('native_module'); | |
// delete the interceptor and forward normal functionality |
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
function animate(target, oldIndex) { | |
var below = document.querySelectorAll('#scoreboard :nth-child('+oldIndex+'), #scoreboard :nth-child('+oldIndex+')~li'); | |
var old = document.querySelector('#scoreboard :nth-child('+oldIndex+')'); | |
var y = target.offsetTop; | |
var style = '-webkit-transition: All 1.5s ease-in-out; -webkit-transform: translate(0, '+y * -1+'px)'; | |
var restStyle = '-webkit-transition: All 1.0s ease-in-out; -webkit-transform: translate(0, 20px)'; | |
target.setAttribute('style', style); | |
setTimeout(function() { |
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
<html> | |
<head> | |
<script> | |
window.onload=(function() { | |
var button = document.querySelector('#change'); | |
button.addEventListener('click', function(evt) { | |
var target = document.querySelector('#container :nth-child(3)'); | |
var old = document.querySelector('#container :nth-child(1)'); | |
animate(target, old); | |
}); |