Skip to content

Instantly share code, notes, and snippets.

Avatar
💡
converting ideas to code

Roni Nes FLasH3r

💡
converting ideas to code
View GitHub Profile
View LICENSE.txt
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
View grayscale-disable.css
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}
View high-dpi-media.css
/* ---------------------------------------------------------- */
/* */
/* 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 */
View LICENSE.txt
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
View orientationchange.js
/**
* "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 /
View querySelector.js
// returns first element selected - $('input[name="food"]')
var $ = document.querySelector.bind(document);
// return array of selected elements - $$('img.dog')
var $$ = document.querySelectorAll.bind(document);
@FLasH3r
FLasH3r / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View README.md

DOM Ready

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

@FLasH3r
FLasH3r / EncDec.class.php
Created May 13, 2012
Encrypt/Decrypt Simple Class
View EncDec.class.php
class EncDec {
private $securekey, $iv;
function __construct($key) {
$this->key = hash('sha256',$key,true);
$this->iv = mcrypt_create_iv(32);
}
function encrypt($input) {
$encData = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key , $input, MCRYPT_MODE_ECB, $this->iv);
return base64_encode($encData);
}
@FLasH3r
FLasH3r / external_social
Created Jul 24, 2012
Better way to add Facebook, Twitter, Google Plus and any other external scripts
View external_social
<script type="text/javascript">
// By Kasper Mikiewicz @ http://blog.idered.pl/post/better-way-to-add-facebook-twitter-google-plus-and-any-other-external-scripts
var scripts = {
'facebook-jssdk': '//connect.facebook.net/en_US/all.js#xfbml=1',
'googleplus' : 'https://apis.google.com/js/plusone.js',
'twitter-wjs' : '//platform.twitter.com/widgets.js',
'analytics' : ('https:'==location.protocol?'//ssl':'//www') + '.google-analytics.com/ga.js'
}, script, _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];