Skip to content

Instantly share code, notes, and snippets.

View nobuti's full-sized avatar
Stop me

Buti nobuti

Stop me
View GitHub Profile
@nobuti
nobuti / server
Created September 29, 2015 09:33
Browser-sync + Rails 4.2 (without tearing out the asset pipeline) So far so good
#!/usr/bin/env bash
set -e
rails s webrick & sleep 3
browser-sync start --files "app/views/**/*.erb, app/assets/stylesheets/**/*.scss, app/assets/javascripts/**/*.js" --proxy "localhost:3000" --reload-delay 1000 --no-open
# For SCSS-Lint v0.31.0
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BorderZero:
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
.arc path {
stroke: #F8F8F8;
stroke-width: 4px;
}
/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;
@nobuti
nobuti / gist:9131387
Created February 21, 2014 09:36
Bidi detection on inputs texts
// From http://closure-library.googlecode.com/svn-history/r27/trunk/closure/goog/docs/closure_goog_i18n_bidi.js.source.html
// with modifications
bidi_helpers = (function(){
var module = {}
/**
* Directionality enum.
* @enum {number}
*/
@nobuti
nobuti / gist:4662944
Created January 29, 2013 09:21
Rakefile for small sinatra app, with a task to deploy to Webfaction.
require 'rubygems'
require 'bundler'
Bundler.require
require 'rspec/core/rake_task'
ENV['RACK_ENV'] ||= 'development'
task :default => :help
@nobuti
nobuti / .excludes
Created January 15, 2013 17:36 — forked from dwayne/.excludes
# Exclude files that don't need to be on the server
# Used by rsync when deploying code to the server
.excludes
.git
.gitignore
log/
tmp/
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
background-image: image-url($image);
background-size: $width $height;
}
@nobuti
nobuti / gist:3816985
Created October 2, 2012 07:11
MySQL tables for continent names, country names and their ISO codes
CREATE TABLE IF NOT EXISTS `continents` (
`code` CHAR(2) NOT NULL COMMENT 'Continent code',
`name` VARCHAR(255),
PRIMARY KEY (`code`)
) ENGINE=InnoDB;
INSERT INTO `continents` VALUES
('AF', 'Africa'),
('AS', 'Asia'),
('EU', 'Europe'),