Skip to content

Instantly share code, notes, and snippets.

View makefunstuff's full-sized avatar
😇
Why?

Iurii Plugatariov makefunstuff

😇
Why?
View GitHub Profile
require 'optparse'
# options hash to store parsed results
options = {}
# initialize option parser
OptionParser.new do |opts|
# provide banner with basic usage example
opts.banner = "USAGE do awesome stuff"
# our rule to parse
opts.on("-m", "--magick", "This stores our magick value") do |v|
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(
Rails.root.join("config/routes/#{routes_name}.rb")
))
end
end
// bootstrap example
.row
.col-md-12
.col-md-4
%button.btn.btn-default.btn-lg
// semantic ui example
.row
.twelwe.wide.colum
var Player = require('player')
player = new Player(process.argv[2]);
player.play();
gulp.task('browser-sync', function() {
browserSync({
open: false,
server: {
baseDir: './dist',
middleware: [historyApiFallback]
}
});
});
// Returns a correction value for the given breakpoint
// to prevent media query overlapping.
//
// Relies on the global variable $slicer-anti-overlap-corrections
// that should contain a list of allowed correction values.
//
// Returns either only positive or only negative value.
//
// anti-overlap-correction($bp, $positive: true)
// - $bp : a breakpoint, e. g. 800px or 20em
////////////////////////////////////////////////
// If you don't understand what's going on here,
// please read the README first.
////////////////////////////////////////////////
// Wraps the content block provided with a media query
// with min-width equal to the left edge of the left slice
// and max-width equal to the right edge of the right slice
//
// between($slice-left, $slice-right, $no-query: false)
//////////////////////////////
// Default Variables
//////////////////////////////
// Default Features
$breakpoint-default-media: all !default;
$breakpoint-default-feature: min-width !default;
$breakpoint-default-pair: width !default;
// Default Transforms
$breakpoint-force-media-all: false !default;
@import "breakpoint-slicer/variables",
"breakpoint-slicer/helper-functions",
"breakpoint-slicer/mixins";
@makefunstuff
makefunstuff / jade.js
Created June 7, 2015 21:42
determine current view
gulp.task('views', function() {
var views = config.views
return gulp.src(views.src)
.pipe($.plumber({errorHandler: $.notify.onError("Error: <%= error.message %>")}))
.pipe($.data(function(file) {
return _.extend(config.app, {currentView: path.basename(file.path).replace('.jade', '')})
}))
.pipe($.jade({
pretty: true,
data: config.app