This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* OSQA theme style.css | |
* Modified the default OSQA style, removing a lot of backgrounds and drop shadows. | |
* | |
* Replace the file at osqa-server/forum/skins/default/media/style/style.css | |
* | |
* Original source from OSQA v0.9 beta2 | |
* Last modified: Feb 23, 2011 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A simple shell script for installing my favorite stuffs on | |
# Ubuntu 12.04 LTS | |
# Author : Ramesh Jha <rameshjha420@gmail.com>, <http://blog.sudobits.com> | |
# License : MIT | |
# update your system | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.10; | |
use warnings FATAL => "all"; | |
use Dancer; | |
use URI::Escape qw(uri_escape_utf8); | |
# This is all the search engine does | |
get '/search' => sub { | |
given (param("q")) { | |
when (/^(?:!(?:ducky)?\s+|\\)(.*)/) { redirect 'http://www.google.com/search?btnI=1&q=' . uri_escape_utf8 $1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = "/home/mrhuman/apps/YOUR_APP_NAME/current" | |
working_directory root | |
pid "#{root}/tmp/pids/unicorn.pid" | |
stderr_path "#{root}/log/unicorn.log" | |
stdout_path "#{root}/log/unicorn.log" | |
# change the YOUR_APP_NAME to your application name | |
listen "/tmp/unicorn.YOUR_APP_NAME.sock" | |
worker_processes 2 | |
timeout 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'deploy' | |
# Uncomment if you are using Rails' asset pipeline | |
load 'deploy/assets' | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/home/mrhuman/apps/YOUR_APP_NAME/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production" | |
AS_USER=mrhuman | |
set -u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/capistrano" | |
#require "delayed/recipes" | |
server "YOUR_IP_ADDRESS", :web, :app, :db, primary: true | |
set :rails_env, "production" #added for delayed job | |
set :application, "YOUR_APP_NAME" | |
set :user, "mrhuman" | |
set :deploy_to, "/home/#{user}/apps/#{application}" | |
set :deploy_via, :remote_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
test: | |
adapter: sqlite3 | |
database: db/test.sqlite3 | |
pool: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin name@example.com | |
ServerName example.com | |
DocumentRoot /home/user_name/example.com/ | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName www.example.com | |
Redirect permanent / http://example.com/ | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming the file is there in the same dir as numbers.txt | |
file = File.open("numbers.txt", 'r') | |
frequency_db = Hash.new | |
file.each_line do |line| | |
line_n = line.split | |
line_n.each do |n| | |
if frequency_db.has_key?(n) | |
frequency_db[n]+=1 |
OlderNewer