Skip to content

Instantly share code, notes, and snippets.

View towry's full-sized avatar
🎯
Focusing

Towry Wang towry

🎯
Focusing
View GitHub Profile
@philippbosch
philippbosch / cross-browser-rgba-mixin.scss
Created July 19, 2010 10:49
image-less RGBA backgrounds for real browsers and Internet Explorer
@mixin rgba-background($color, $opacity) {
background-color: $color;
background-color: rgba($color, $opacity);
background-color: transparent\9;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))},endColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))});
zoom: 1;
}
@pguillory
pguillory / gist:729616
Created December 5, 2010 23:51
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@guileen
guileen / app.js
Created April 20, 2011 23:55
Express Custom 404
var express = require('express'),
mongoose = require('mongoose'),
app;
app = module.exports = express.createServer();
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
@JoeOsborn
JoeOsborn / SpriteLayer.h
Created June 28, 2011 21:53
SpriteLayer, a CALayer subclass for spritesheet-based animation
//
// SpriteLayer.h
//
// Created by Joseph C Osborn on 2011.01.12.
// Copyright 2011 Universal Happy-Maker. All rights reserved.
// This code is made available under the 3-clause BSD license:
// http://www.opensource.org/licenses/BSD-3-Clause
//
#import <Foundation/Foundation.h>
@guilleiguaran
guilleiguaran / assets.rake
Created September 1, 2011 04:26
Fixed rake assets:precompile task
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
# We need to do this dance because RAILS_GROUPS is used
# too early in the boot process and changing here is already too late.
if ENV["RAILS_GROUPS"].to_s.empty? || ENV["RAILS_ENV"].to_s.empty?
ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"
Kernel.exec $0, *ARGV
else
Rake::Task["environment"].invoke
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@kizu
kizu / dabblet.css
Created January 18, 2012 21:39
Repeating sprites using border-image
/**
* Repeating sprites using border-image
*/
/**
* It's just some border-image craziness, don't
count this as a working solution: for repeating
on both axis you'll need a hell of a hacks:
not only the rendering is differ in webkits vs.
other browsers, but there is a big difference in
Safari vs. Chrome. I just went craze while dealing
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong