Skip to content

Instantly share code, notes, and snippets.

View buley's full-sized avatar
🤑

Tay buley

🤑
View GitHub Profile
@rubiojr
rubiojr / mr_status_bar_app.rb
Created November 30, 2009 11:47
MacRuby StatusBar Application
#
# Initialize the stuff
#
# We build the status bar item menu
def setupMenu
menu = NSMenu.new
menu.initWithTitle 'FooApp'
mi = NSMenuItem.new
mi.title = 'Hellow from MacRuby!'
mi.action = 'sayHello:'
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@mattetti
mattetti / hello_world.rb
Created May 14, 2010 07:23
MacRuby Hello World
framework 'AppKit'
class AppDelegate
def applicationDidFinishLaunching(notification)
voice_type = "com.apple.speech.synthesis.voice.GoodNews"
@voice = NSSpeechSynthesizer.alloc.initWithVoice(voice_type)
end
def windowWillClose(notification)
puts "Bye!"
@nichtich
nichtich / README.txt
Created June 8, 2010 11:50
Simple PDF file indexing with Solr
This gist contains two files for simple indexing of PDF files.
== requirements ==
First you need to install Solr (which requires a Java JDK): Download a tar or zipfile at http://www.apache.org/dyn/closer.cgi/lucene/solr/ and unpack it to a directory of your choice. Go into this directory and start solr running in jetty by:
$ cd example
$ java -jar start.jar
Then locate your browser to http://localhost:8983/solr/
@ahx
ahx / app.js
Created October 23, 2010 20:26
small demo for handlebars.js, jQuery 1.4.3 data events and require.js
/* small demo for handlebars.js, jQuery, require.js */
/*global Handlebars */
var cart = {
products: [
],
total: function() {
var sum = 0;
for(var i in this.products) {
sum += this.products[i].price;
@indexzero
indexzero / journey-and-node-static.js
Created November 20, 2010 20:18
An example of using Journey with Node-Static in node.js
var sys = require('sys'),
http = require('http'),
static = require('node-static'),
journey = require('journey');
exports.createRouter = function () {
return new (journey.Router)(function (map) {
//
// Version Binding
@thomasyip
thomasyip / apple_theme_boxflex.css
Created November 29, 2010 06:50
Boxflex for iPhone app pane
/**
* Extracted from: https://github.com/beedesk/jQTouch/commit/b5d2fc63fe15acba15c4e8eaafc0e128997f8484
*/
/* ============= from themes/apple/theme.css ============= */
#jqt > * {
-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;
background: rgb(197,204,211) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAABCAIAAACdaSOZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpiPHrmCgMC/GNjYwNSAAEGADdNA3dnzPlQAAAAAElFTkSuQmCC);
-webkit-user-select: ignore;
@mtigas
mtigas / 0001.markdown
Last active February 15, 2018 17:04
Command-line s3 uploader that uses the MultiPart (chunked) S3 upload functionality to parallelize and speed up large file uploads.
@mohamedmansour
mohamedmansour / background.html
Created January 9, 2011 07:07
Google Chrome Extension for No Browsing History
<!DOCTYPE html>
<html>
<head>
<script>
// Fired when a URL is visited, providing the HistoryItem data for that URL.
chrome.history.onVisited.addListener(function(historyItem) {
// Deletes all items from the history.
chrome.history.deleteAll(function() {});
});
</script>
@gobengo
gobengo / node-gchat.js
Created January 22, 2011 06:17
node.js-driven Google Chat bot
var xmpp = require('node-xmpp'),
secret = require('./secret'),
util = require('util');
var creds = {
jid: 'bengoering@gmail.com',
password: secret.pw, //string
};
var GChat = function(creds) {