Skip to content

Instantly share code, notes, and snippets.

View FLasH3r's full-sized avatar
💡
converting ideas to code

Roni Nes FLasH3r

💡
converting ideas to code
View GitHub Profile
@FLasH3r
FLasH3r / README.md
Last active August 29, 2015 14:24 — forked from dciccale/README.md

DOM Ready

Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.

@FLasH3r
FLasH3r / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// returns first element selected - $('input[name="food"]')
var $ = document.querySelector.bind(document);
// return array of selected elements - $$('img.dog')
var $$ = document.querySelectorAll.bind(document);
/**
* "orientationchange" Event Polyfill
* by Jason LuBean
*
* This polyfill allows you to use "window.orientation"
* and to bind to the "orientationchange" event. It has
* no dependencies on any libraries, but has support for
* using jQuery to bind to the "orientationchange" event.
*
* Because IE8 does not allow you to use attachEvent /
@FLasH3r
FLasH3r / LICENSE.txt
Last active August 29, 2015 14:06 — forked from addyosmani/README.md
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2014
Copyright (C) 2014 Addy Osmani @addyosmani
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(0%);
}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@FLasH3r
FLasH3r / function-name.js
Created December 1, 2013 06:41
function-name - Get the name of a named function
/*!
function-name
Get the name of a named function
https://github.com/sindresorhus/function-name
by Sindre Sorhus
MIT License
*/
function functionName(fn) {
if (typeof fn !== 'function') {
throw new TypeError('Expected a function.');
@FLasH3r
FLasH3r / console.save.js
Created November 19, 2013 13:58
console.save - A simple way to save objects as .json fle from the console // original: http://bgrins.github.io/devtools-snippets/#console-save
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'