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 / EncDec.class.php
Created May 13, 2012 17:25
Encrypt/Decrypt Simple Class
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 July 24, 2012 14:55
Better way to add Facebook, Twitter, Google Plus and any other external scripts
<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']];
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
// to capture ALL events use:
Ext.util.Observable.prototype.fireEvent =
Ext.util.Observable.prototype.fireEvent.createInterceptor(function() {
console.log(this.name);
console.log(arguments);
return true;
});
// to capture events for a particular component:
Ext.util.Observable.capture(
@FLasH3r
FLasH3r / README
Created September 11, 2013 07:21 — forked from joelambert/README
Cross Browser requestAnimFrame
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@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; }
@FLasH3r
FLasH3r / console.fallback.js
Created October 21, 2013 12:36
Console fallback for IE
if (typeof console === "undefined") {
var m = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),
console = { },
mt = function () {};
for (var i = 0, len = m.length; i < len; i++) { console[m[i]] = mt; }
}
@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'
@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.');
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