Skip to content

Instantly share code, notes, and snippets.

View ralph-tice's full-sized avatar

Ralph Tice ralph-tice

  • Kentik
  • Texas
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 30, 2024 12:48
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@mariusae
mariusae / gen.ml
Created September 13, 2010 07:10
python generators in ocaml using delimcc
type ('a, 'b) t = Done | More of 'a * ('b -> ('a, 'b) t)
let gen f =
(*
* Note: the first value to yield gets thrown away as the generator
* has not yet started.
*)
let start _ =
let p = Delimcc.new_prompt () in
Delimcc.push_prompt p begin fun () ->
import io.Source
import scala.util.control.Breaks._
/**
* Scala TicTacToe game without any side effects
*
* Written in response to following post (which also contains task description):
* http://blog.tmorris.net/scala-exercise-with-types-and-abstraction/
*/
object TicTacToe {
@howardr
howardr / varnish-jsonp.vcl
Created April 5, 2011 17:14 — forked from simonw/varnish-jsonp.vcl
Vanish JSONP hack fork
backend default {
.host = "127.0.0.1";
.port = "8000";
}
# We go BACK to varnish to get it to generate an ESI template that
# generates a JSON-P response.
backend jsonp_template_backend {
.host = "127.0.0.1";
.port = "8070";
@mza
mza / validate.rb
Created May 6, 2011 10:32
Really simple CloudFormation template validation
require 'rubygems'
require 'fog'
require 'yaml'
config = YAML::load_file(File.dirname(__FILE__) + '/config.yml')
cf = Fog::AWS::CloudFormation.new(
:aws_access_key_id => config['key'],
:aws_secret_access_key => config['secret']
)
@bohde
bohde / graphite_pip_uwsgi_recipe.sh
Created November 28, 2011 18:08 — forked from bfritz/graphite_pip_uwsgi_recipe.sh
installing graphite-web with pip and running under uwsgi
# graphite-web install is hardcoded in setup.cfg to /opt/graphite
sudo mkdir /opt/graphite
sudo chown brad.users /opt/graphite
# run under python2.7 virtualenv
virtualenv --python=python2.7 ~/ve/graphite
source ~/ve/graphite/bin/activate
# install the necessary python packages (simplejson is for flot graphs)
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson
@willf
willf / inverted_index.scala
Created December 23, 2011 16:54
Create an inverted index from a file
/**
* From a file that contains
* doc_id w1 w2 w3 ... lines, separated by tabs
* return an inverted index Map of w -> Set(doc_id)
*
* @param filename well isn't it obvious
* @return Map[String,Set[String]]
*/
import scala.collection.immutable.Map
@rodionmoiseev
rodionmoiseev / gist:2484934
Created April 25, 2012 00:41
Setting up Play 2.0 in build.gradle
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){
@mardambey
mardambey / AkkaKafkaMailboxTest.scala
Last active August 3, 2019 05:03
Akka 2.0 actors with Kafka 0.7.x backed durable mailboxes.
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.agent.Agent
import com.typesafe.config.ConfigFactory
import akka.event.Logging
import akka.actor.Props
import kafka.utils.Utils
import java.nio.ByteBuffer
@stonegao
stonegao / AkkaKafkaMailboxTest.scala
Created May 1, 2012 07:24 — forked from mardambey/AkkaKafkaMailboxTest.scala
Akka 2.0 actors with Kafka backed durable mailboxes.
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.agent.Agent
import com.typesafe.config.ConfigFactory
import akka.event.Logging
import akka.actor.Props
import kafka.utils.Utils
import java.nio.ByteBuffer