I wrote my first program 25 years ago.
embed: hello.bas
title: Jacek Becela is Blogist | |
layout: 427820 | |
index: | |
- 426631 |
I wrote my first program 25 years ago.
embed: hello.bas
This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.
OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.
Code | |
$("button").single_double_click(function () { | |
alert("Try double-clicking me!") | |
}, function () { | |
alert("Double click detected, I'm hiding") | |
$(this).hide() | |
}) | |
# this code snippet was inspired by | |
# http://www.igvita.com/2010/04/15/non-blocking-activerecord-rails/ | |
require 'fiber' # needed to use Fiber.current | |
require 'rubygems' | |
require 'mysqlplus' | |
require 'eventmachine' | |
require 'em-mysqlplus' | |
def query(sql) |
# Net::HTTPResponse streaming for use in Rack apps with Fibers! | |
def read_body # Net::HTTPResponse#read_body | |
yield "foo"; yield "bar"; yield "baz" | |
end | |
class R # A Rack Streaming response | |
def initialize | |
@f = Fiber.new do | |
read_body do |chunk| # Net::HTTPResponse#read_body |
# see http://github.com/intridea/oauth2 | |
require 'rubygems' | |
require 'sinatra' | |
require 'oauth2' | |
require 'json' | |
class ConnectionLogger < Faraday::Middleware | |
def call(env) | |
env[:response].on_complete do |env| | |
puts "RESULT: #{env[:status]}\n#{env[:body]}" |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'aws/s3' | |
S3_CREDENTIALS = File.expand_path(File.join('~', '.s3', 'auth.yml')) | |
APP = 'darkblog' | |
BUCKET = 's3.blog.darkhax.com' | |
def bundle |
Old way: | |
$ git checkout -b preandpost_fork_hooks scotttam/preandpost_fork_hooks | |
Branch preandpost_fork_hooks set up to track remote branch preandpost_fork_hooks from scotttam. | |
Switched to a new branch 'preandpost_fork_hooks' | |
New way: | |
$ git checkout preandpost_fork_hooks | |
Branch preandpost_fork_hooks set up to track remote branch preandpost_fork_hooks from scotttam. |
/* | |
Author: Jacek Becela (http://github.com/ncr) | |
License: MIT | |
$("img").sqrop() // square crop with side length equal to shorter side of image | |
$("img").sqrop(200) // square crop with 200px side length, image scaled accordingly | |
Inspiration: http://www.seifi.org/css/creating-thumbnails-using-the-css-clip-property.html | |
*/ |