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 / nice-shadow.scss
Created Jul 29, 2016
Collection of Nice Shadow effects
View nice-shadow.scss
.shadow1 {
box-shadow: 0 0 20px 1px rgba(114,114,189,0.1);
}
@we4tech
we4tech / country_field.js.jsx.coffee
Created Mar 30, 2016
An Example of How to Use React from AngularJS
View country_field.js.jsx.coffee
window.UIControls.CountryField = React.createClass
mixins: [CountriesMixin]
getInitialState: -> {code: @props.data}
changeCountry: (evt) ->
code = evt.currentTarget.value
@setState(code: code)
@props.onChange(code) if @props.onChange?
@we4tech
we4tech / pre-push
Created Nov 9, 2015
GIT Pre push script to prevent from accidental force push to master branch
View pre-push
#!/usr/bin/env ruby
# Make sure you have 'colorize' gem installed already.
require 'colorize'
current_branch = `git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,'`
push_cmd = `ps -ocommand | grep "git push"`
if current_branch =~ /\/master/ && push_cmd =~ /(\-f|force|delete)/
puts '*********************************************'.colorize(:red)
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 / 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
@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 / 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 / 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 / cleanup.rb
Created Jul 13, 2014
Replace none alpha numeric unicode characters.
View cleanup.rb
text.gsub(/[^[[:alnum:]]]/, ' ').gsub(/\s+/, ' ')
@we4tech
we4tech / common_api_response.rb
Last active Aug 29, 2015
A simple and quick way to generate restful api for any model.
View common_api_response.rb
# spec/support/shared/common_api_response.rb
shared_examples 'common api response' do |param_key|
it 'responds in json' do
expect(response.content_type).to be == 'application/json'
end
it "assigns #{param_key}" do
expect(assigns(param_key.to_sym)).not_to be_nil
end
You can’t perform that action at this time.