Skip to content

Instantly share code, notes, and snippets.

@ayosec
ayosec / README.md
Last active August 29, 2015 13:56
Sweet.js: Better for

Add for(value <- items) and for(value, offset <- items) to Sweet.js

Examples

for(x <- [1,2,3,4]) {
  var a = x + 10;
  print(a);
}
[package]
name = "map"
version = "0.0.0"
authors = ["Jorge Aparicio <japaricious@gmail.com>"]
[dependencies.criterion]
git = "https://github.com/japaric/criterion.rs"
@ayosec
ayosec / cypher.rb
Last active August 29, 2015 14:26
Launch Cypher queries
#!/usr/bin/env ruby
case ARGV.size
when 1
host = ARGV[0]
body = STDIN.read
when 2
host = ARGV[0]
body = ARGV[1]
else
@portertech
portertech / tailable.rb
Created November 7, 2010 05:46
tailable cursor (MongoDB)
#!/usr/bin/ruby -w
require 'rubygems'
require 'mongo'
require 'thread'
include Mongo
db = Connection.new('localhost',27017,:slave_ok => true).db('test')
coll = db['cappedCollection']
@akitaonrails
akitaonrails / Gemfile
Created January 8, 2011 19:55
AkitaOnRails.com Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
platforms :jruby do
gem 'activerecord-jdbc-adapter', :require => false
gem 'activerecord-jdbcmysql-adapter', :require => false
@viktorklang
viktorklang / PostStart.scala
Created March 5, 2011 23:13
PostStart implementation for Akka
trait PostStart { actor: Actor =>
def postStart: Unit
override def preStart {
actor.become {
case "PostStart" => try { postStart } finally { actor.unbecome }
}
actor.self ! "PostStart"
}
}
@ayosec
ayosec / README.md
Created November 17, 2011 00:18
Custom keyboard for X

So, what's this?

A little modification over the default spanish keyboard.

With this rules you can type á with «AltGr»+«a», é with «AltGr»+«e», whatever. The symbol is on «AltGr»+«e», and ® is on «AltGr»+«Shift»+«e»

Installation

  • Create a directory ~/.xkb and download the custom and load_custom_xkb.sh
  • Add /home/.../.xkb/load_custom_xkb.sh to your session. In GNOME you can use the gnome-session-propertiescommand.
@ayosec
ayosec / .bashrc
Last active September 30, 2015 03:08
Some dot-files
# For devel machines
# PS1 in use, one per chroot jail
PS1='\[\e[36m\]\u@'`cat ~/.machine_name`' \[\e[32m\][$rvm_env_string] \[\e[35m\]($(git symbolic-ref HEAD 2> /dev/null | xargs -r basename))\[\e[36m\] \w\$\[\e[m\] '
PS1='\[\e[0;48;5;229m\]\u@'`cat ~/.machine_name`' \[\e[32m\][$rvm_env_string] \[\e[35m\]($(git symbolic-ref HEAD 2> /dev/null | xargs -r basename))\[\e[36m\] \w\$\[\e[m\] '
@jaju
jaju / pi.rb
Created March 25, 2012 16:30
Akka.io - Pi calculating actors example ported to JRuby
require 'java'
require 'mvn:org.scala-lang:scala-library'
require 'case'
module Akka
include_package 'akka.actor'
include_package 'akka.util.duration'
java_import 'akka.routing.RoundRobinRouter'
java_import 'akka.util.Duration'
end
@ayosec
ayosec / README.md
Created July 17, 2012 13:08
Scripts to start a Xvnc server inside a machine

Xvnc

The scripts in this gist will start an Xvnc server with a basic window manager (IceWM). This is intended to use in a virtual machine, where we can need to start a browser to run a test suite.

Installation on Debian

All commands have to be run as root

apt-get install icewm vnc4server