Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<script>
var event
if (document.createEvent) {
event = document.createEvent("HTMLEvents")
event.initEvent("payment", true, true)
} else {
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
package ca.underflow.hbase
import org.hbase.async._
import com.stumbleupon.async._
object Demo extends App {
// This let's us pass inline functions to the deferred
// object returned by most asynchbase methods
Time.at(1234).gmtime.strftime('%R:%S')
val pattern = java.util.regex.Pattern.compile ("""(?xs) ("(.*?)"|) ; ("(.*?)"|) (?: \r?\n | \z ) """)
val matcher = pattern.matcher (input)
while (matcher.find) {
val col1 = matcher.group (2)
val col2 = matcher.group (4)
// ...
}
require 'app/helpers/mass_sql_helper'
class FixtureDump
extend MassSqlHelper
def self.to_fixture data, path
File.open("#{Rails.root}/spec/fixtures/#{path}.json", 'wb') { |f| f.write Oj.dump(data, mode: :compat) }
end
def self.from_ar_to_fixtures ar_query, path
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_SLOTS_INCREMENT=300000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=79000000
@timothyklim
timothyklim / Main.scala
Created April 19, 2013 05:27
Scala + GA
package com.test.ga
import akka.util.Timeout
import scala.concurrent.Future
import akka.actor._
import spray.can.client.HttpClient
import spray.client.HttpConduit
import spray.io._
import spray.util._
import spray.http._
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
location ~ ^/uploads {
upload_pass @app;
upload_store /tmp/async_nginx_store 1;
upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.content_type "$upload_content_type";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
upload_store_access user:r;