Skip to content

Instantly share code, notes, and snippets.

View candidosales's full-sized avatar
🏠
Focusing

Candido Sales Gomes candidosales

🏠
Focusing
View GitHub Profile
@gpspake
gpspake / ie-top-bar-fix.scss
Last active August 29, 2015 14:00
Foundation top-bar-fix
/**
*
*Sassified version of tmayr's gist: https://gist.github.com/tmayr/5190565
*
*/
.lt-ie9 {
.top-bar {
background: #2f2f2f;
@phoenixMag00
phoenixMag00 / gist:680779f6fa15ba9d28ef
Created May 14, 2014 19:27
Grunt File to UNCSS WordPress site
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
set_max_files: {
command: 'ulimit -n 1024'
},
get_grunt_sitemap: {
pt-BR:
flash:
actions:
create:
notice: "%{resource_name} criado com sucesso."
alert: "* Preencha todos os campos corretamente."
update:
notice: "%{resource_name} foi atualizado com sucesso."
destroy:
notice: "%{resource_name} foi removido com sucesso."
@etagwerker
etagwerker / unicorn.default.rb
Created December 29, 2010 19:39
default unicorn configuration
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
worker_processes 2
# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
working_directory "/home/deployer/myapp.com/current"
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/tmp/myapp.com.sock", :backlog => 64
listen 8080, :tcp_nopush => true
@gertig
gertig / 0_steps
Created March 31, 2012 20:26
VPS Setup and Deployment (Railscasts.com #335)
When building a new instance of Amazon EC2 choose quick-start-1 as the security group not default
#LOCALLY
$ capify .
$ chmod +x config/unicorn_init.sh
$ git add .
$ git commit -m "deployment configs"
If rebuilding an instance don't forget to remove the ssh keys
@peterberkenbosch
peterberkenbosch / gist:7655098
Created November 26, 2013 08:31
update to Spree 2-1-stable
gem 'spree', github: 'spree/spree', branch: '2-1-stable'
bundle update spree
bundle exec rake railties:install:migrations
bundle exec rake db:migrate
@JangoSteve
JangoSteve / ubuntu_rails_install.rb
Created January 22, 2011 17:58
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
@tmayr
tmayr / gist:5190565
Created March 18, 2013 20:34
Foundation Topbar IE8 Fix
.lt-ie9 .top-bar {
background: #2f2f2f;
*zoom: 1;
overflow: visible;
}
.lt-ie9 .top-bar:before, .lt-ie9 .top-bar:after {
content: " ";
display: table;
}
.lt-ie9 .top-bar:after { clear: both; }
@benvium
benvium / proguard-rules.txt
Last active January 5, 2018 07:57
Android proguard file to remove log messages. This is tested and actually works with Android Studio 0.8.8 You need to add some lines to the build.gradle file (see notes below) Includes library-specific rules for Guava, Crashlytics, OkHttp, Retrofit, Otto
######################################################
# Proguard file to remove debug logs and NOT kill the application
#
# @benclayton github.com/benvium 15-12-2014
#
# https://gist.github.com/benvium/8995326bc944f47f2c64
######################################################
# To use this file, your project's build.gradle 'buildTypes' section should look like this:
#
@deadkff01
deadkff01 / divideWithLogarithms.js
Last active April 18, 2018 18:50
JavaScript divide function without using "/"
// Multiplication and division rules... ((+)*(+)=+) ((-)*(-)=+) ((+)*(-)=-) ((-)*(+)=-)
const multiply = (x, y) => {
let r = Math.exp(Math.log(Math.abs(x)) + Math.log(Math.abs(y))).toFixed(2)
return Number((x < 0 && y < 0) ? r : (x < 0 || y < 0) ? -r : r)
}
const divide = (x, y) => {
return (x === 0) ? 0 : multiply(((multiply(x, y) < 0) ? -1.0 : 1.0), Math.exp(Math.log(Math.abs(x)) - Math.log(Math.abs(y))))
}