Skip to content

Instantly share code, notes, and snippets.

View achiurizo's full-sized avatar
🌐

Arthur Chiu achiurizo

🌐
View GitHub Profile
@nrrrdcore
nrrrdcore / border.css
Created May 2, 2012 20:44
Faded/Gradient Borders in Pure CSS
.border-container {
width: 28%; /* border will be on the left on this container */
float: right;
overflow: hidden; /* only needed if floating container */
min-height: 600px; /* static height if you want your container to be taller than its content */
-moz-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
-webkit-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
border-width: 0 0 0 1px;
-webkit-border-image:
@javan
javan / screenshot.js
Created June 19, 2012 21:40
Create a screenshot of any URL using phantomjs (headless webkit)
//
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png
//
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.open(url, function (status) {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 31, 2026 19:44
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#include <stdlib.h>
#include <stdio.h>
#include <ruby.h>
#include <node.h>
#include <oboe/oboe.h>
oboe_reporter_t udp_reporter;
#ifdef RUBY_GC_EVENT_ALL
// requires https://github.com/tmm1/brew2deb/blob/master/packages/ruby/patches/gc-hooks.patch
@jordansissel
jordansissel / README.md
Last active October 7, 2015 06:38
prototype of a 'stdlib sucks so I had to write my own' benchmarking library for ruby

improving ruby benchmarking

stdlib's 'benchmark' is not good, at least, for every use case I've ever had for benchmarking.

So here's some hacking I did tonight.

Benchmarking Sequel

db = Sequel.sqlite("/tmp/example.db")
require 'base64'
def public_base64(key)
["ssh-rsa", Base64.encode64(ssh_public_key_conversion(key)).gsub("\n", "")].join(" ").strip
end
def ssh_public_key_conversion(public_key)
out = [0, 0, 0, 7].pack("C*")
out += "ssh-rsa"
@steveklabnik
steveklabnik / Gemfile
Created July 24, 2012 21:52
Hypermedia Proxy pattern in JSON
source :rubygems
gem 'sinatra'
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@josevalim
josevalim / 0_README.md
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

@nesquena
nesquena / default.vcl
Created September 27, 2012 04:52 — forked from alanmackenzie/default.c
Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish. - Fixed for Varnish 3.0.2-1 on Ubuntu.
# For Varnish NewRelic Tracking
# https://gist.github.com/2820068
C{
#include <stddef.h>
#include <stdio.h>
#include <sys/time.h>
}C
sub vcl_recv {