Skip to content

Instantly share code, notes, and snippets.

View AlexKVal's full-sized avatar

Alex Shemetovskiy AlexKVal

View GitHub Profile
@joshblack
joshblack / watchify-reactify-gulp.js
Created November 20, 2014 03:00
Gulpfile for doing watchify builds with the react transformer all hooked up to browser sync.
var gulp = require('gulp');
var util = require('gulp-util');
var watchify = require('watchify');
var reactify = require('reactify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
function makeStyle(defaults, tagName) {
tagName = tagName || 'div';
var Style = React.createClass({
getDefaultProps: function() {
return assign({}, defaults);
},
render: function() {
var style = assign({}, this.props);
delete style.children;
@Peeja
Peeja / group_of_thingies.rb
Created December 4, 2011 02:08 — forked from coffeencoke/group_of_thingies.rb
Test a block in Ruby
class GroupOfThingies
attr_accessor :thingies
# Use like this:
#
# group_of_thingies = GroupOfThingies.new
# group_of_thingies.each do |thing|
# puts "Check out this awesome thing: #{thing}!"
# end
#
@justin808
justin808 / pgk.zsh
Last active April 10, 2017 23:04
Script to kill errant rails development processes
export PROCESSES_TO_QUIT='bpos puma rake sidekiq spring rails$ ruby-debug phantomjs zeus passenger guard resque "node server.js" ruby$ node foreman fsevent_wat'
pgr() {
echo "Finding processes in list: $PROCESSES_TO_QUIT"
echo $PROCESSES_TO_QUIT | xargs -n 1 pgrep -l
}
pgk() {
echo "Killing processes in list: $PROCESSES_TO_QUIT"
echo $PROCESSES_TO_QUIT | xargs -n 1 pkill -l
#! /bin/ruby
def main argv
n = (argv[0] || 2).to_i rescue 2
m = (argv[1] || 20).to_i rescue 20
g = n_gram n
g.
enum_for(:each_pair).
lazy.
sort_by {|k, v| -v }.
@RReverser
RReverser / better-console-log.js
Last active May 9, 2019 21:07
Better console.log in Node
// UPD:
// Now available as npm module!
// Check out https://github.com/RReverser/better-log for details.
console.log = (function (log, inspect) {
return function () {
return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
return inspect(arg, { depth: 1, colors: true });
}));
};
var gulp = require('gulp');
var browserify = require('browserify');
var notify = require('gulp-notify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
var csso = require('gulp-csso');
var watch = require('gulp-watch');
var envify = require('envify');
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.

@joemaddalone
joemaddalone / filltextGist
Last active April 25, 2020 09:26
gist example for filltext.com
{
"rows" : "!",
"id" : "{index}",
"active" : "{bool}",
"fname" : "{firstName}",
"lname" : "{lastName}",
"category" : "[13,16,19,21]",
"tel" : "{phone}",
"address" : "{addressObject}",
"cc" : "{ccObject}",

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.