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
public static int count(int digits) { | |
if (digits % 2 == 0) { | |
return countEven(digits); | |
} else { | |
return countOdd(digits); | |
} | |
} | |
public static int countEven(int digits) { | |
// +1 -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
irb(main):004:0> CSV.dump([Object.new]) | |
=> "class,Object\n\n\n" | |
irb(main):005:0> CSV.load(CSV.dump([Object.new])) | |
=> [#<Object:0x00000100ae90d8>] |
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
irb(main):001:0> require 'oj' | |
=> true | |
irb(main):002:0> Oj | |
=> Oj | |
irb(main):003:0> Oj.dump(Object.new) | |
=> "{\"^o\":\"Object\"}" | |
irb(main):004:0> Oj.load("{\"^o\":\"Object\"}") | |
=> #<Object:0x0000010115c5f0> |
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 ApplicationHelper | |
def escape_js(str) | |
str.gsub('<', '\u003C').gsub('>', '\u003E').gsub('&', '\u0026').gsub("\u2028", '\u2028').gsub("\u2029", '\u2029').html_safe | |
end | |
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
--- !ruby/object:Gem::Specification | |
name: xpath | |
version: !ruby/object:Gem::Version | |
prerelease: false | |
segments: | |
- 0 | |
- 1 | |
- 4 | |
version: 0.1.4 | |
platform: ruby |
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
#!/bin/bash | |
# * * * * * root /path/to/riak_graphite_stats.sh | |
set -e | |
SOURCE=$(hostname) | |
GRAPHITE_PORT=2003 | |
GRAPHITE_SERVER="server" | |
PREFIX="riak_stats" | |
STATUS=$(/usr/sbin/riak-admin status) |
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
#!/bin/bash | |
# * * * * * root /path/to/riak_stats.sh | |
set -e | |
SOURCE=$(hostname) | |
LIBRATO_USERID="" | |
LIBRATO_TOKEN="" | |
PREFIX="test.riak" |
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
grep $'[\177-\377]' file |
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 <unistd.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <sys/wait.h> | |
#include <stdlib.h> | |
#define CAPACITY (65536) | |
#define PROGRAM "./level06" |
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(replicator). | |
-export([replicator/0]). | |
replicator() -> | |
Eval = fun(S, Env) -> | |
{ok, Scanned,_} = erl_scan:string(S), | |
{ok,Parsed} = erl_parse:parse_exprs(Scanned), | |
erl_eval:exprs(Parsed, Env) | |
end, |