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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
# Idea of : Thibault (@EyeWriteCode) | |
require 'Twitter' #gem install twitter | |
begin | |
# Create a read application from : | |
# https://apps.twitter.com | |
# authenticate it for your account | |
# fill in the following | |
config = { |
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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
require 'gosu' | |
include Gosu | |
$dimension = 200 | |
$line_limit = 70 | |
class GameWindow < Window |
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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
require "selenium-webdriver" # gem install selenium-webdriver | |
require "highline/import" # gem install highline | |
def coderwall github_email, github_password, title, content, tags | |
driver = Selenium::WebDriver.for :firefox | |
driver.navigate.to "https://coderwall.com/auth/github" |
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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
require 'json' | |
require 'open-uri' | |
require 'uri' | |
require 'net/http' | |
CODE_LIMIT = 10 | |
$url = "https://eval.in/" | |
$languages = { |
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 | |
dir="$1" | |
shift 1 | |
mkdir "$dir" | |
cd "$dir" | |
bundler init | |
echo "gem 'rails'" >> Gemfile |
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
require 'bcrypt' | |
class User | |
include DataMapper::Resource | |
attr_accessor :password, :password_confirmation | |
timestamps :at | |
property :id, Serial |
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
# Task: Implement the rcat utility and get these tests to pass on a system | |
# which has the UNIX cat command present | |
# To see Gregory Brown's solution, see http://github.com/elm-city-craftworks/rcat | |
# Feel free to publicly share your own solutions | |
rrequire "open3" | |
working_dir = File.dirname(__FILE__) | |
gettysburg_file = "#{working_dir}/data/gettysburg.txt" |
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
class MyApplication < Sinatra::Base | |
use Rack::Session::Cookie | |
use Warden::Manager do |manager| | |
manager.default_strategies :password | |
manager.failure_app = MyApplication | |
end | |
Warden::Manager.serialize_into_session{ |user| user.id } |
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 remac() { | |
local progress='.oO°Oo' | |
local airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport | |
local ssid=$($airport -I|awk '/^ *SSID/ {print $2}') | |
local iface=$(networksetup -listallhardwareports|grep -A1 Wi-Fi|awk '/Device:/ {print $2}') | |
local mac=${1:-00$(openssl rand -hex 5|sed 's/\(..\)/:\1/g')} | |
echo Disconnecting Wi-Fi $iface from SSID $ssid to set new mac address $mac... | |
sudo $airport -z | |
local i n=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
import os | |
from PIL import Image | |
from flask import Flask, request, redirect, url_for | |
from werkzeug import secure_filename | |
from flaskext.uploads import (UploadSet, configure_uploads, IMAGES, | |
UploadNotAllowed) | |
app = Flask(__name__) | |
app.config['UPLOADED_PHOTOS_DEST'] = '/tmp/testuploadext' |
OlderNewer