Skip to content

Instantly share code, notes, and snippets.

View cheeyeo's full-sized avatar
💭
Researching on use of transformers in computer vision

Chee Yeo cheeyeo

💭
Researching on use of transformers in computer vision
View GitHub Profile
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
<!-- This is how you lay out cross-browser columns. Stick to this and you're golden -->
<style>
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
@cheeyeo
cheeyeo / README.md
Created February 14, 2011 21:22 — forked from mloughran/README.md

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@cheeyeo
cheeyeo / gfm.rb
Created February 15, 2011 20:25 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
@cheeyeo
cheeyeo / README.md
Created February 18, 2011 19:19 — forked from anonymous/README.md
EM + Twitter Stream example

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

require 'rubygems'
require 'carrierwave'
require 'fileutils'
# needed for the RMagick module in CarrierWave
def current_path
@current_path
end
include CarrierWave::RMagick
@cheeyeo
cheeyeo / gist:1242013
Created September 26, 2011 10:56 — forked from jugyo/gist:1210929
Spork.each_run
Spork.each_run do
silence_warnings do
Dir[Rails.root.join('app/**/*.rb')].each do |file|
load file
end
end
FactoryGirl.reload
end
@cheeyeo
cheeyeo / script_test.js
Created October 9, 2011 19:00 — forked from billywhizz/script_test.js
testing vm script functionality in node.js
var vm = require('vm'),
code = 'var square = n * n;',
fn = new Function('n', code),
script = vm.createScript(code),
sandbox;
n = 5;
sandbox = { n: n };
benchmark = function(title, funk) {
@cheeyeo
cheeyeo / gist:1657718
Created January 22, 2012 17:14 — forked from jugyo/gist:1646320
an example of auth for facebook
require 'thread'
require 'facebook_oauth'
require 'launchy'
require 'sinatra/base'
callback_uri = URI.parse('http://localhost:6789/')
fb_client = FacebookOAuth::Client.new(
:application_id => 'XXXXXXXXXXXX',
:application_secret => 'XXXXXXXXXXXXXXXXXXXXXXXX',
# Set the number of connections AR pool
#
# place in an initializer such as: config/connection_pool.rb
Rails.application.config.after_initialize do
ActiveRecord::Base.connection_pool.disconnect!
ActiveSupport.on_load(:active_record) do
config = Rails.application.config.database_configuration[Rails.env]
config['pool'] = ENV['DB_POOL'] || 6