Skip to content

Instantly share code, notes, and snippets.

View adi518's full-sized avatar
🌴
On vacation

Adi adi518

🌴
On vacation
View GitHub Profile
@yckart
yckart / jquery.act.js
Created December 2, 2012 23:58
jQuery function to allow multiple events via `on`-event on one element with different functions and target selectors
;(function($) {
$.fn.act = function() {
var args = arguments;
return this.each(function() {
for (var i = args.length; i--;) {
$(this).on(args[i][0], args[i][1], args[i][2]);
}
});
};
})(jQuery);
@bullrico
bullrico / ie8-font-smoothing.scss
Created May 5, 2014 16:37
IE8 icon font smoothing
@font-face {
font-family: 'icomoon';
src:url('../../fonts/icomoon.eot?-acamik');
src:url('../../fonts/icomoon.eot?#iefix-acamik') format('embedded-opentype'),
url('../../fonts/icomoon.woff?-acamik') format('woff'),
url('../../fonts/icomoon.ttf?-acamik') format('truetype'),
url('../../fonts/icomoon.svg?-acamik#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@FLasH3r
FLasH3r / clearfix_v1.css
Last active November 23, 2016 12:58
clearfix variations (with original source link)
/*
* source: http://nicolasgallagher.com/micro-clearfix-hack/
*/
.clearfix:before, .clearfix:after { content: " "; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
@jixunmoe
jixunmoe / bind.gen.without.ctx.js
Last active July 6, 2017 12:27
[ES6] Bind generator without context.
/**
* Bind generator with context preserved.
* @param {Generator} fn The generator
* @return {Generator} Generator with arguments bind.
*/
var _bind = function (fn) {
var args = [].slice.call(arguments, 1);
return function * () {
var ir = fn.apply (this, args.concat.apply(args, arguments));
var n;
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
// Current Persons Data Structure in Client
const clientData = [{
id: 1,
employed: true
},
{
id: 2,
employed: false
},
function findEvenIndex(arr)
{
var left = 0, right = arr.reduce(function(pv, cv) { return pv + cv; }, 0);
for(var i = 0; i < arr.length; i++) {
if(i > 0) left += arr[i-1];
right -= arr[i];
if(left == right) return i;
}
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@urish
urish / javascript-iot-tapas.md
Last active December 8, 2017 08:30
JavaScript IoT Tapas Resources
@cades
cades / HOC-after-2.2.0.js
Created April 21, 2017 05:51
higher-order component for vue.js 2
export default function(WrappedComponent) {
const mixinProps = (WrappedComponent.mixins || [])
.filter((mixin) => mixin.props)
.map((mixin) => mixin.props);
const allProps = mixinProps.concat(WrappedComponent.props);
const mergedProps = allProps.reduce((merged, props) => Object.assign(merged, props), {});
return {
props: mergedProps,
render(createElement) {