- base64_fixed_point.rb https://gist.github.com/epitron/4736881
- enum_weave.rb https://gist.github.com/epitron/a1807e9148d901e4cdd8
- webfile.rb https://gist.github.com/epitron/92bf23bfceaf07e5da66
- binding-addition.rb https://gist.github.com/epitron/6015603
- tweet-anagrams.rb https://gist.github.com/epitron/6479184
- epitest.rb https://gist.github.com/epitron/6628722
- rle.rb https://gist.github.com/epitron/7758166
- binary_rle.rb https://gist.github.com/epitron/897535
- proxy_controller.rb https://gist.github.com/epitron/7758166
- nokogiri_walk_tree.rb https://gist.github.com/epitron/10033479
This file contains hidden or 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
from math import * | |
import os | |
import time | |
width = 60 | |
height = 40 | |
def clear(): | |
print "\x1b[2J", |
This file contains hidden or 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
require 'paint' | |
include Math | |
class Waves | |
BLOCKS = [ "█", "▓", "▒", "░" ] | |
attr_reader :width, :height | |
def initialize |
This file contains hidden or 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
#!/usr/bin/env python2 | |
# coding=utf-8 | |
from math import * | |
from time import sleep | |
import os | |
import random | |
import sys | |
write = sys.stdout.write |
This file contains hidden or 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
[11:12 PM] epi@bort :: ~/src/depot_tools $ ./gn | |
Traceback (most recent call last): | |
File "./gn.py", line 38, in <module> | |
sys.exit(main(sys.argv)) | |
File "./gn.py", line 22, in main | |
bin_path = gclient_utils.GetBuildtoolsPlatformBinaryPath() | |
File "/home/epi/src/depot_tools/gclient_utils.py", line 713, in GetBuildtoolsPlatformBinaryPath | |
buildtools_path = GetBuildtoolsPath() | |
File "/home/epi/src/depot_tools/gclient_utils.py", line 701, in GetBuildtoolsPath | |
buildtools_path = os.path.join(primary_solution, 'buildtools') |
This file contains hidden or 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
QUESTION 6: Write a function multi_gsub that performs multiple, simultaneous | |
search-and-replace operations on a string. | |
Example: | |
"Lorem Ipsum #9191".multi_gsub([[/[a-z]/i, '#'], [/#/, 'P']]) | |
=> "##### ##### P9191" |
This file contains hidden or 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
Objects have methods and instance variables | |
A class, and its instances, are Objects | |
A class is an Object that can create other Objects | |
An instance is an object that holds data and lets you run methods on it. | |
self refers to the object in which your code is currently executing | |
(ie: in an instance method, "self" is the instance |
This file contains hidden or 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
<div id="fb-root"></div> | |
<script src="//connect.facebook.net/<%= @locale %>/all.js"></script> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : <%= @fbappid %>, // App ID | |
<% if Rails.env.production? %> | |
channelUrl : '//garbage.herokuapp.com/channel.html', // Channel File | |
<% else %> | |
channelUrl : '//localhost:3000/channel.html', // Channel File |
This file contains hidden or 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
require 'coderay' | |
require 'pp' | |
require 'epitools' | |
# | |
# Example tokenization: | |
# | |
# [ | |
# ["toggle", :ident], ["(", :operator], | |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'readline' | |
while line = Readline.readline("crystal> ") | |
line = %{puts "=> \#{(#{line}).inspect}"} | |
system("crystal", "eval", line) | |
end |