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
upstream railsapp { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out). | |
server 10.0.0.5:8182; | |
#server unix:/var/www/meralabour/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name app.atsquare.in; |
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 'haml' | |
class ErbEngine < Haml::Engine | |
def push_script(text, preserve_script, in_tag = false, preserve_tag = false, | |
escape_html = false, nuke_inner_whitespace = false) | |
push_text "<%= #{text.strip} %>" | |
end | |
def push_silent(text, can_suppress = false) | |
push_text "<% #{text.strip} %>" |
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 'csv' | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, :confirmable, :token_authenticatable, | |
:recoverable, :rememberable, :trackable, :authentication_keys => [:rollno] | |
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
#user nobody; | |
worker_processes 10; | |
error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
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
<html> | |
<body> | |
<form> | |
<textarea class="span12" rows="20" cols="100"></textarea> | |
</form> | |
<script language="Javascript"><!-- | |
var tl=new Array( | |
"The requested document is no more.", | |
'No file found.', |
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
(setq inhibit-startup-message t) ;; Removes startup message | |
(setq-default indent-tabs-mode nil) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(auto-save-default t) |
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
[user] | |
name = Magesh | |
email = magesh@atsquare.in | |
[color] | |
ui = true | |
[alias] | |
timeline = log --graph --all --format=format:'(%cr) %s%d' --date-order --abbrev-commit --date=relative | |
timelog = log --graph --pretty=format:'%Cgreen(%cr) -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit -- | |
dlog = log --graph --date-order -C -M --pretty=format:'%ad [%an] %Cgreen%d%Creset %s' --all --date=short |
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
[user] | |
name = Magesh | |
email = magesh@atsquare.in | |
[color] | |
ui = true | |
[alias] | |
timeline = log --graph --all --format=format:'(%cr) %s%d' --date-order --abbrev-commit --date=relative |
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
task :migrate_wp => :environment do | |
wp = Mysql2::Client.new(:host => "localhost", :username => "root", :password => "root", :database => "mageshblog") | |
results = wp.query("select * from wp_zxdasg_posts;") | |
results.each do |r| | |
Post.create( | |
:user_id => r["author"], | |
:date => r["post_date"], | |
:content => r["post_content"], | |
:title => r["post_title"], |