Skip to content

Instantly share code, notes, and snippets.

View lwille's full-sized avatar
🏳️‍🌈
🤠

Leonhardt Wille lwille

🏳️‍🌈
🤠
View GitHub Profile
@nowhereman
nowhereman / awesome_nested_set_helper.rb
Created August 26, 2010 12:32
Awesome Nested Set Helper who returns options for select with only one DB query.
# Copy this file in RAILS_ROOT/config/initializers/awesome_nested_set_helper.rb
module CollectiveIdea::Acts::NestedSet::Helper
# Like #nested_set_options helper but with only one DB query
#
# Returns options for select.
# You can exclude some items from the tree.
# You can pass a block receiving an item and returning the string displayed in the select.
#
# == Params
@Burgestrand
Burgestrand / .gitignore
Created March 12, 2011 22:12
libspotify example creating a playlist and adding tracks to it
example
appkey.c
login.c
@leepowelldev
leepowelldev / gist:1164762
Created August 23, 2011 09:53
Node.js Apache Virtual Host Proxy
<VirtualHost *:80>
ServerAdmin default
ServerName nodejs.localhost
ProxyPass / balancer://ourexamplecluster
ProxyPassReverse / balancer://ourexamplecluster
<proxy balancer://ourexamplecluster ourexamplecluster="">
BalancerMember http://127.0.0.1:8000
</proxy>
</virtualhost>
@oparrish
oparrish / bootstrap_pagination_helper.rb
Created September 28, 2011 18:35
Link renderer to be used with will_paginate to render links to work with Twitter Bootstrap
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
else
link(page, "#", :class => 'active')
end
@tj
tj / ast.js
Created October 25, 2011 12:16
Declarative JS
[ [ 'rule', 'parse upload' ],
[ 'indent' ],
[ 'rule', 'with all images' ],
[ 'indent' ],
[ 'rule', 'scale image to 800x600' ],
[ 'rule', 'save image to disk' ],
[ 'rule', 'save image to gridfs' ],
[ 'outdent' ],
[ 'outdent' ],
[ 'eos' ] ]
@jpawlowski
jpawlowski / msys_hetzner-etc_network_interfaces
Created August 12, 2012 12:06
Debian network configuration for Proxmox VE server running on a Hetzner host
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
# device: eth0
iface eth0 inet manual
# IPv4 bridge
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!)
@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@joscha
joscha / meteor-async.md
Last active August 29, 2017 06:51 — forked from possibilities/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished.

@hugooliveirad
hugooliveirad / git-useful.md
Last active December 5, 2019 16:27
git-useful

git-useful

a collection of useful commands to use Git and GitHub.

Add

add files interactively

git add <file> --patch

# working example