This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: '<json:package.json>', | |
concat: { | |
js: { | |
src: 'app/public/js/src/*.js', | |
dest: 'app/public/js/app.js' | |
}, | |
css: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
setopt promptsubst | |
autoload -U add-zsh-hook | |
PROMPT_SUCCESS_COLOR=$FG[117] | |
PROMPT_FAILURE_COLOR=$FG[124] | |
PROMPT_VCS_INFO_COLOR=$FG[242] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var browserify = require('browserify'); | |
var source = require('vinyl-source-stream'); | |
var del = require('del'); | |
var paths = { | |
js: './app/assets/js/app.js', | |
watch_js: ['app/assets/js/**/*.js', 'app/assets/js/*.js'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markup = Hbuilder::Builder.html do | |
div class: 'main' do | |
h1 body: 'hello world' | |
p body: 'some text lalalalal' | |
img alt: 'lalalal', src: 'http://placekitten.com/200/300' | |
end | |
end | |
markup # => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIMES = ENV["TIMES"] ? ENV["TIMES"].to_i : 10000000 | |
WIDTH = `tput cols`.to_i - 23 | |
def timer | |
t1 = Time.now | |
yield | |
Time.now - t1 | |
end | |
TIMES_TIME = timer { TIMES.times {} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RApp | |
def initialize(app) | |
@_computed_methods = app[:computed] | |
set_bindings(app[:vars]) | |
end | |
private | |
def set_bindings(vars) | |
vars.each do |k,v| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
min(X, Y, X) :- X < Y. | |
min(X, Y, Y) :- X >= Y. | |
max(X, Y, X) :- X >= Y. | |
max(X, Y, Y) :- X < Y. | |
min_member([X], X). | |
min_member([H | T], X) :- min_member(T, I), min(H, I, X). | |
remove(_, [], []). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% PACK SECTION | |
pack([X|Unpacked], Packed) :- pack(Unpacked, [[X]], Packed). | |
pack([H|T], [[H|Acc]|Rest], Packed) :- pack(T, [[H,H|Acc]|Rest], Packed). | |
pack([X|T], [[Y|Acc]|Rest], Packed) :- | |
X \= Y, | |
pack(T, [[X],[Y|Acc]|Rest], Packed). | |
pack([], RPacked, Packed) :- reverse(RPacked, Packed). | |
% UTILS SECTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.directive('jquery-change', { | |
twoWay: true, | |
bind: function() { | |
var self = this; | |
$(self.el).on('change', function() { | |
self.set(this.value); | |
}); | |
}, | |
update: function(data) { | |
if(data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
folder_path = ENV['FOLDER'] | |
from = Regexp.new(ENV['FROM']) | |
to = ENV['TO'] | |
Dir.glob(folder_path + "*").sort.each do |f| | |
filename = File.basename(f, File.extname(f)) | |
new_filename = filename.gsub(from, to) | |
File.rename(f, folder_path + new_filename + File.extname(f)) | |
end |
OlderNewer