Skip to content

Instantly share code, notes, and snippets.

View xiaoronglv's full-sized avatar
💭
😊

Ryan Lyu xiaoronglv

💭
😊
View GitHub Profile
@jalquisola
jalquisola / gist:9b69e7468b826e81bd7a
Created June 4, 2014 02:33
LoadError: cannot load such file -- sidekiq/capistrano for sidekiq >= 3.0
#Add gem into Gemfile and do bundle install
gem "capistrano-sidekiq"
#replace "require 'sidekiq/capistrano'" in Capfile
require 'capistrano/sidekiq'
upstream app_name {
server unix:///tmp/app_name.sock;
}
server {
listen 80;
server_name example.com; # change to match your URL
root /rails/app/folder/public; # change to match your rails app public folder
@luugiathuy
luugiathuy / nginx_configuration
Last active April 6, 2018 18:58
nginx configuration
upstream app_name {
server unix:///tmp/app_name.sock;
}
server {
listen 80;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
@JasonGiedymin
JasonGiedymin / rabbitmq.rake
Created November 19, 2011 21:34
Easy RabbitMQ Start/Stop Rake tasks for OSX
#
# Don't want to run PostgreSQL as a service? Want to manually start and stop it?
# >> bundle exec rake rabbitmq:mac:start
# >> bundle exec rake rabbitmq:mac:stop
#
namespace :rabbitmq do
namespace :mac do
desc "Starts a Mac brew installed RabbitMQ server."
@vadviktor
vadviktor / client.rb
Created December 23, 2015 16:49
Ruby unix socket server-client receive-respond
require "socket"
socket = UNIXSocket.new('/tmp/simple.sock')
puts "==== Sending"
socket.write("Hello server, can you hear me?\n")
puts "==== Getting Response"
puts socket.readline
@ivanoats
ivanoats / .railsrc
Last active August 11, 2020 09:33 — forked from gringocl/gist:8480696
# .railsrc
-B #Skip Bundle
-T #Skip Test-Unit
-d postgresql #Use postgres
@Integralist
Integralist / Hash Keys to Symbols.rb
Last active September 2, 2020 08:50
Convert Ruby Hash keys into symbols
hash = { 'foo' => 'bar' }
# Version 1
hash = Hash[hash.map { |k, v| [k.to_sym, v] }]
# Version 2
hash = hash.reduce({}) do |memo, (k, v)|
memo.tap { |m| m[k.to_sym] = v }
end
@pol
pol / wos.php
Created October 28, 2011 04:59
Web of Science API access with ruby libs
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
@strika
strika / rails_engine_migrations.rb
Created May 7, 2018 08:56
Append migrations from a Rails engine to the main application
initializer :append_migrations do |app|
unless app.root.to_s.match(root.to_s)
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
end
end
end
@Gregg
Gregg / gist:968534
Created May 12, 2011 13:54
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.