Skip to content

Instantly share code, notes, and snippets.

View oroce's full-sized avatar

Róbert Oroszi oroce

  • Budapest, Hungary
View GitHub Profile
@jpurcell
jpurcell / pull-to-refresh(android).js
Created April 5, 2011 15:58
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
@benbahrenburg
benbahrenburg / gist:948579
Created April 29, 2011 16:32
Login Example
// create tab group
demo.tabMainGroup = Ti.UI.createTabGroup({isOpen:false});
demo.tabLoginGroup = Ti.UI.createTabGroup({isOpen:false});
demo.wLogin = Ti.UI.createWindow({
id:'wLogin'
});
demo.tbLogin = Ti.UI.createTab({window:demo.wLogin});
@jamesarosen
jamesarosen / 04_jshint.rake
Created May 2, 2011 23:41
Javascript Loves CI: Jenkins + Jasmine + PhantomJS + JSHint
namespace :jshint do
task :require do
sh "which jshint" do |ok, res|
fail 'Cannot find jshint on $PATH' unless ok
end
end
task :check => 'jshint:require' do
project_root = File.expand_path('../../', File.dirname(__FILE__))
config_file = File.join(project_root, 'config', 'jshint.json')
@marksteve
marksteve / Backbone.View.Autocomplete.js
Created May 3, 2011 10:54
Backbone View for jQuery UI Autocomplete inputs
var Autocomplete = Backbone.View.extend({
render: function() {
var choices = this.options.choices,
selected = this.options.selected,
iterator = this.options.iterator,
label = this.options.label,
allowDupes = this.options.allowDupes,
$el = $(this.el);
$el.autocomplete({
source: function(request, response) {
@geraldalewis
geraldalewis / debug_mode_for_coffee_script.md
Created May 15, 2011 23:10
Debug mode for running .coffee scripts #558, #987

Debug mode for running .coffee scripts #558, #987

Adds a --debug option for .coffee scripts that outputs more helpful error messages (mapping compiled .js lines of code to the input .coffee file's lines).

This branch should be considered experimental at the moment -- it serves as a proof-of-concept and to expose additional issues with adding debugging support to CoffeeScript

Current output:

TypeError: string is not a function

@kwhinnery
kwhinnery / app.js
Created June 10, 2011 15:45
Faking Long Touch on Android in Titanium Mobile
//The table view row just has to have a full height view in order
//to trigger the TableView touchstart
function LongTouchTableViewRow(_title) {
var row = Ti.UI.createTableViewRow({
height:50
});
var v = Ti.UI.createView({
height:50
});
@ijanos
ijanos / sleepsort.bash
Created June 15, 2011 16:41
Sleep sort!
#!/bin/bash
# Sleep sort
# http://dis.4chan.org/read/prog/1295544154
function f() {
sleep "$1"
echo "$1"
}
@eliperelman
eliperelman / LICENSE.txt
Created June 20, 2011 20:39 — forked from 140bytes/LICENSE.txt
String trim methods polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@benvanstaveren
benvanstaveren / gist:1044959
Created June 24, 2011 14:59
file upload to mongodb
if(my $upload = $self->req->upload('myfile')) {
my $filename = $upload->filename;
my $asset;
if(ref($upload->asset) ne 'Mojo::Upload::File') {
$asset = Mojo::Asset::File->new(path => POSIX::tmpnam);
$asset->add_chunk($upload->asset->slurp);
} else {
$asset = $upload->asset;
}
@tsaniel
tsaniel / LICENSE.txt
Created July 17, 2011 07:37 — forked from 140bytes/LICENSE.txt
JSON stringify
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE