Skip to content

Instantly share code, notes, and snippets.

Erik Berlin sferik

Block or report user

Report or block sferik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1_class_refactored_solution.rb
def valid?(card_number)
digits = card_number
.map { |number| number.to_i }
numbers = []
digits.each_with_index do |digit, index|
if index.even?
numbers << digit * 2
View stratus-customization.html
<script type="text/javascript">
auto_play: true,
download: false,
key: "Enter your Client ID here",
links: '',
random: true
View stratus-installation.html
<script type="text/javascript">
key: "Enter your Client ID here",
links: ""
View twitter-friends.rb
require 'csv'
require 'twitter'
def twitter_client
@twitter_client ||= do |config|
config.consumer_key = 'XXXXXX'
config.consumer_secret = 'XXXXXX'
config.access_token = 'XXXXXX'
config.access_token_secret = 'XXXXXX'
View gist:7324739
# Node A:
# iex --sname "nodea"
Process.register self, :iex
# Blocking
receive do
{ :hello, pid } ->
IO.puts "Hello from #{inspect(pid)}"
View future.ex
defmodule Future do
def new(fun) do
fn(x) ->
spawn_link fn ->
value = try do
{ :ok, fun.(x) }
e -> { :error, e }
View google_products_search.rb
require 'json'
require 'open-uri'
require 'uri'
class GoogleProductsSearch
def self.find_all_by_query(query)
file = open("{ENV["GOOGLE_PRODUCTS_API_KEY"]}&country=US&q=#{URI.escape(query)}")
JSON.load(["items"] || []

WDI Lab - April 8, 2013


You will be creating a movies app using Sinatra and the OMDB API.


  • Ability to search for a movie by title
  • Ability to click on a search result to see detailed information about a movie including:
    • Title
    • Year
View gist:5129879


Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA
sferik / passwords_controller.rb
Created Nov 17, 2012 — forked from kazpsp/passwords_controller.rb
StrongParameters with Devise
View passwords_controller.rb
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation, :reset_password_token)
private :resource_params
You can’t perform that action at this time.