Skip to content

Instantly share code, notes, and snippets.

var run=function(n){var e={input:n,output:null,error:null};try{e.output=runHidden(n)}catch(l){e.error=l.message}"undefined"===e.output&&(e.output=""),application.remote.output(e)},runHidden=function(code){var indexedDB=null,location=null,navigator=null,onerror=null,onmessage=null,performance=null,self=null,webkitIndexedDB=null,postMessage=null,close=null,openDatabase=null,openDatabaseSync=null,webkitRequestFileSystem=null,webkitRequestFileSystemSync=null,webkitResolveLocalFileSystemSyncURL=null,webkitResolveLocalFileSystemURL=null,addEventListener=null,dispatchEvent=null,removeEventListener=null,dump=null,onoffline=null,ononline=null,importScripts=null,application=null,log_a=[];"undefined"!=typeof console&&("undefined"!=typeof console.log?console.olog=console.log:console.olog=function(){}),console.log=function(n){log_a.push(n)},console.error=console.debug=console.info=console.log;var result;try{result=eval(code)}catch(e){result=e.message}return log_a.push(result),log_a.join("\n")},stringify=function(n){var e;
// executes the given code and handles the result
var run = function(code) {
var result = {
input: code,
output: null,
error: null
};
try {
//result.output = stringify(runHidden(code));
// executes the given code and handles the result
var run = function(code) {
var result = {
input: code,
output: null,
error: null
};
try {
var run=function(n){var l={input:n,output:null,error:null};try{l.output=stringify(runHidden(n))}catch(e){l.error=e.message}"undefined"===l.output&&(l.output=""),application.remote.output(l)},runHidden=function(code){var indexedDB=null,location=null,navigator=null,onerror=null,onmessage=null,performance=null,self=null,webkitIndexedDB=null,postMessage=null,close=null,openDatabase=null,openDatabaseSync=null,webkitRequestFileSystem=null,webkitRequestFileSystemSync=null,webkitResolveLocalFileSystemSyncURL=null,webkitResolveLocalFileSystemURL=null,addEventListener=null,dispatchEvent=null,removeEventListener=null,dump=null,onoffline=null,ononline=null,importScripts=null,application=null;return eval(code)},stringify=function(n){var l;return l="undefined"==typeof n?"undefined":null===n?"null":JSON.stringify(n)||n.toString()};application.setInterface({run:run});
@daniely
daniely / plugin
Last active April 22, 2016 19:20
// executes the given code and handles the result
var run = function(code) {
var result = {
input: code,
output: null,
error: null
};
try {
@daniely
daniely / multiple_ssh_setting.md
Created March 22, 2016 17:03 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@daniely
daniely / rolify_with_fixtures.md
Created May 13, 2015 19:00
rolify with fixtures

I'm using rails 4.2 and had a tough time with rolify and rails fixtures. After some mucking I finally got it working. Posting here incase someone else needs to do something similar.

  1. Create a UsersRole model in models/users_role.rb
# pretty much exclusively created for our fixtures to work
class UsersRole < ActiveRecord::Base
  belongs_to :user
  belongs_to :role
end
@daniely
daniely / rspec-syntax-cheat-sheet.rb
Created September 26, 2011 14:35 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@daniely
daniely / gist:997745
Created May 29, 2011 12:32 — forked from jasonm/gist:194554
Faking $stdin for testing in Ruby
require 'test/unit'
class InputFaker
def initialize(strings)
@strings = strings
end
def gets
next_string = @strings.shift
# Uncomment the following line if you'd like to see the faked $stdin#gets
@daniely
daniely / ruby koans watchr file
Created April 19, 2011 05:02
Super simple watchr for ruby koans
watch('(.*)\.rb') { system "rake" }