Skip to content

Instantly share code, notes, and snippets.

nhm tanveer hossain khan (hasan) we4tech

Block or report user

Report or block we4tech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@we4tech
we4tech / site.conf
Created Aug 15, 2014
Rails4 and Angularjs with Nginx + Proxy cache
View site.conf
upstream puma {
server 127.0.0.1:8080 fail_timeout=0;
}
proxy_cache_path /home/of/all/evil/stuffs/as/shared/tmp/cache/nginx levels=1:2 keys_zone=api-cache:10m max_size=1000m inactive=200m;
# HTTP server
#
server {
@we4tech
we4tech / app_logrotate.conf
Last active Aug 29, 2015
Rails or ruby application logrotate configuration.
View app_logrotate.conf
"/path/to/application/current/log/*.log" {
daily
su user_name group_name
size 5M
missingok
rotate 5
compress
delaycompress
notifempty
copytruncate
@we4tech
we4tech / state.rb
Last active Aug 29, 2015
Countries with states
View state.rb
class State
STATES = {
'US' => {
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
@we4tech
we4tech / Gemfile
Created Feb 28, 2015
Gemfile for Rails 4.2.0 with Angularjs, Jasmin, Rspec, FactoryGirl and so on.
View Gemfile
source 'https://rubygems.org'
source 'https://rails-assets.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
View ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/opt/php55-xdebug/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=1
xdebug.idekey="PHPSTORM"
@we4tech
we4tech / stage.js
Created Aug 6, 2011
Using node-control i've built my deployment script, it was fun and easy to do and go :)
View stage.js
var control = require('control'),
script = process.argv[1],
perform = control.perform,
task = control.task;
var ProjectConfig = {
rootDir: 'staging',
git: 'git://github.com/we4tech/restaurant-review.git',
branch: 'master',
serverPort: 4000
@we4tech
we4tech / deploy.js
Created Aug 11, 2011
Using node-control i've built my deployment script, it was fun and easy to do and go :)
View deploy.js
var control = require('control'),
script = process.argv[1],
perform = control.perform,
task = control.task;
/**
* Project related configuration
*/
var ProjectConfig = {
// Keep it simple word so we could use it for Rails environment too.
@we4tech
we4tech / autoclosing-issue
Created Nov 18, 2011
Haml issue with autoclosing
View autoclosing-issue
-- HAML
#new_schedule{title: "Add Schedule"}
%form
%fieldset.ui-helper-reset
%label{for: "tab_title"} Title
%input#tab_title.ui-widget-content.ui-corner-all{type: "text", name: "tab_title", value: ""}
-- Converted HTML
<div id='new_schedule' title='Add Schedule'>
<form>
@we4tech
we4tech / faq_item_spec.rb
Created Nov 28, 2011
spec for faq item model
View faq_item_spec.rb
require 'spec_helper'
describe FaqItem do
context 'validations' do
it 'should validate the presence of question' do
should validate_presence_of(:question)
end
it 'should validate the presence of answer' do
@we4tech
we4tech / faq_item_spec.rb
Created Nov 28, 2011
spec for faq item model
View faq_item_spec.rb
require 'spec_helper'
describe FaqItem do
context 'validations' do
it 'should validate the presence of question' do
should validate_presence_of(:question)
end
it 'should validate the presence of answer' do
You can’t perform that action at this time.