Skip to content

Instantly share code, notes, and snippets.

@m4n
m4n / 9.04.
Created November 2, 2009 07:23 — forked from mrrooijen/9.04.sh
# Author: Michael van Rooijen
# Description:
# A Rails Stack Installer for Ubuntu 8.04/9.04 with the light-weight and fast NginX Web Server.
# This shell script will install a basic Rails Stack with a bunch of useful and commonly used utilities.
# It will install Ruby Enterprise Edition with Phusion Passenger (Reduces Rails Application Memory Usage By Approx. 33%)
# It will install some essential gems like mysql, sqlite, postgres etc.
# It will install NginX Web Server
# It will install the MySQL database
# It will install Git
# It will install these utilities: ImageMagick, FFMpeg, Memcached
require 'racc'
require 'racc/grammarfileparser'
require 'set'
class Trie
Entry = Struct.new(:keys, :value)
def initialize
@tokens = Set.new
@sentences = []
# Everything you need to do to get started with Rails 2.3.8
#
# As of June 14th, 2010 @ 2:30 p.m. MST
#
# This gist now features instructions to get Rails 3 up and running with:
# - Ruby 1.8.7-p174
# - Bundler 0.9.26
# - Cucumber 0.8.0
# - Rspec 1.3.0 + Rspec-Rails 1.3.2
# - RVM
module ActionView
module Helpers
class FormBuilder
Check = Struct.new(:box, :label)
# Behaves almost exactly like the select method, but instead of generating a select tag,
# generates Checks. These consist of two attributes, +box+ and +label+,
# which are (unsurprisingly) the HTML for the check box and the label. Called without a block,
# this method will return an array of check boxes. Called with a block, it will yield each
# check box to your template.
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'
var setCryptData = function (data) {
window.cryptData = data.crypto_key;
};
var submitFormWithCrypto = function (form, callback) {
$.getScript('/profiles/crypto_key?callback=setCryptData', function () {
var queryData = {
key_id: cryptData.id,
encrypted: teaEncrypt($(form).serialize(), cryptData.key)
};

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary

@m4n
m4n / compl1.rb
Created September 10, 2010 20:36 — forked from antirez/compl1.rb
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
@m4n
m4n / index.html
Created June 22, 2011 07:09
HTML5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script type="text/javascript">
</script>
<style text="text/css">
@m4n
m4n / devise.de.yml
Last active December 25, 2015 04:09 — forked from thomasklemm/devise.de.yml
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
de:
devise:
confirmations:
confirmed: "Vielen Dank für deine Registrierung. Bitte logge dich jetzt ein."
confirmed_and_signed_in: "Vielen Dank für deine Registrierung. Du bist jetzt eingeloggt."
send_instructions: "Du erhältst in Kürze eine E-Mail, mit der du deine Registrierung bestätigen kannst."
send_paranoid_instructions: "Falls deine E-Mail-Adresse in unserer Datenbank existiert, erhältst du in Kürze eine E-Mail mit der du deine Registrierung bestätigen kannst."
failure: