Skip to content

Instantly share code, notes, and snippets.

View k2052's full-sized avatar
🦄
awesome

K k2052

🦄
awesome
View GitHub Profile
@quad
quad / multi-browser.vala
Created May 26, 2009 15:35
Minimal WebKit browser examples in Vala
using GLib;
using Gtk;
using WebKit;
public class Browser : Window {
private const string URL = "http://mixtape.quadhome.com/6/";
private Notebook notebook;
public Browser() {
@dwabnitz
dwabnitz / customdomain.rb
Created October 22, 2009 19:18 — forked from speedmax/customdomain.rb
rack middleware to resolve a custom domain to an original subdomain in a multi-tenant application
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and
@gus
gus / index.txt
Created November 30, 2009 21:55 — forked from toothrot/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

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.

Web Application Flow

  • Redirect to this link to request GitHub access:
@nesquena
nesquena / mac_setup.txt
Last active February 10, 2019 17:58
Setup Local Mac
- Run software update
- Install Purchased Apps from App Store
- Disable caps lock key (Sys Pref => Keyboard => Modifier Keys)
- System Pref -> Expose -> Setup corners for spaces and expose
+ System Pref -> Security -> Sleep Password
- Setup Dropbox to Get Files
- Install 1Password
- Use dropbox synced file for keychain
- Install browser extension for chrome
- Install Prey
@maccman
maccman / widget.rb
Created October 19, 2010 09:48
MacRuby Webkit Interface
framework "WebKit"
class Widget
class RPC
class << self
public :include
end
def initialize(widget)
@widget = widget
@joecritch
joecritch / taco.css
Created December 27, 2010 23:06
The Taco grid system by @joecritchley
/** -------------------------------------
* Taco. By Joe Critchley (@joecritchley)
*/
.c { width: 978px; margin: 0 auto; }
.c .c { margin: 0 -20px; width: auto; }
.g1, .g2, .g3, .g4, .g5, .g6, .g7, .g8, .g9, .g10, .g11, .g12 { margin-left: 30px; float: left; display: inline; }
.c .c .g1, .c .c .g2, .c .c .g3, .c .c .g4, .c .c .g5, .c .c .g6,
.c .c .g7, .c .c .g8, .c .c .g9, .c .c .g10, .c .c .g11, .c .c .g12 { margin-left: 10px; }
.g1 { width: 54px; } .c .c .g1 { width: 74px; }
@DTrejo
DTrejo / top3stories.js
Created January 21, 2011 22:41
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@remy
remy / gist:804414
Created January 31, 2011 17:24
Simple CSS parser
function parseCSS(str) {
function trim(str) {
return (str||'').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
var i, j, k,
split = '}',
cur_key = '',
cur_key_split,
css = str.replace(/\t*/g, '').replace(/\s{2}/, ' ').replace(/[\n|\r]/g, ' ').replace(/\/\*.*?\*\//g, '').split(split),
@alloy
alloy / status_bar_view.rb
Created March 30, 2011 09:10
A MacRuby example of a custom view in the status bar, with selection highlight.
class StatusBarView < NSView
attr_reader :progressIndicator, :statusBarItem
def initWithStatusBarItem(item)
bar = item.statusBar
if initWithFrame([[0,0], [bar.thickness, bar.thickness]])
@statusBarItem = item
@highlight = false
origin, size = frame.origin, frame.size