Skip to content

Instantly share code, notes, and snippets.

Dawid Karabin hinok

Block or report user

Report or block hinok

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hinok
hinok / modernizr-2.8.3.js
Created Aug 19, 2017
Modernizr 2.8.3 with all feature-detects
View modernizr-2.8.3.js
/*!
* Modernizr v2.8.3
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
* Available under the BSD and MIT licenses: www.modernizr.com/license/
*/
/*
* Modernizr tests which native CSS3 and HTML5 features are available in
View .zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

View ember-document-bind.js
import Ember from 'ember';
var get = Ember.get;
export default Ember.Component.extend({
didInsertElement: function(){
Ember.$(document).bind('click', this.closeThis);
},
closeThis: function(event) {
@hinok
hinok / gist:a3d413004df3e1ff4bb0
Created Jan 18, 2015
Improved {{#each}} for Ember 1.9 / Handlebars 2.0.0
View gist:a3d413004df3e1ff4bb0
/**
A replacement for #each that provides an index value (and other helpful values) for each iteration.
Unless using `foo in bar` format, the item at each iteration will be accessible via the `item` variable.
Simple Example
--------------
```
{{#eachIndexed bar in foo}}
{{index}} - {{bar}}
{{/#eachIndexed}}
View find.js
/**
* Module dependencies
*/
var util = require('util'),
actionUtil = require('../../node_modules/sails/lib/hooks/blueprints/actionUtil');
/**
* Find Records
*
@hinok
hinok / SassMeister-input.scss
Last active Apr 7, 2017
Generated by SassMeister.com.
View SassMeister-input.scss
//
// I created standalone package, look here
//
// https://github.com/hinok/spejson
//
// ----
// libsass (v3.0.2)
// ----
View angularjs_directive_attribute_explanation.md

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
View user-timing-rum.js
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
View .zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
You can’t perform that action at this time.