Skip to content

Instantly share code, notes, and snippets.

View kewogc's full-sized avatar
🏠
Working from home

Lol kek kewogc

🏠
Working from home
View GitHub Profile
@victorximenis
victorximenis / notificationFx.js
Created March 15, 2016 18:21
Notification FX
;( function( window ) {
'use strict';
var docElem = window.document.documentElement,
support = { animations : Modernizr.cssanimations },
animEndEventNames = {
'WebkitAnimation' : 'webkitAnimationEnd',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
@hateradio
hateradio / html64.rb
Last active April 29, 2024 05:58
ruby image to base64 string
require 'base64'
# converts attached PNGs into base64 strings
# Eg
# <img src="my.png" /> to <img src="data:image/png;base64,..." />
class To64Html
def initialize(path)
@shaundon
shaundon / deep_omit.js
Last active August 29, 2015 14:16
Like underscore's omit function, but works deeply. Works on both objects and arrays. Requires underscore.
var deepOmit = function(input, propertyToRemove) {
var output = input;
if (_.isArray(input)) {
output = [];
_.each(input, function(arrayItem) {
output.push(deepOmit(arrayItem, propertyToRemove));
});
}
else if (_.isObject(input)) {
output = {};
@davidbella
davidbella / person.rb
Created October 10, 2013 13:37
Ruby: Dynamic meta-programming to create attr_accessor like methods on the fly
class Person
def initialize(attributes)
attributes.each do |attribute_name, attribute_value|
##### Method one #####
# Works just great, but uses something scary like eval
# self.class.class_eval {attr_accessor attribute_name}
# self.instance_variable_set("@#{attribute_name}", attribute_value)
##### Method two #####
# Manually creates methods for both getter and setter and then
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

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>
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 13, 2024 07:02
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs