Skip to content

Instantly share code, notes, and snippets.

Avatar
💡
converting ideas to code

Roni Nes FLasH3r

💡
converting ideas to code
View GitHub Profile
@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']];
View notepad.html
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`
View extjs-capture.js
// 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 Sep 11, 2013 — forked from joelambert/README
Cross Browser requestAnimFrame
View README
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 Nov 23, 2016
clearfix variations (with original source link)
View clearfix_v1.css
/*
* 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 Oct 21, 2013
Console fallback for IE
View console.fallback.js
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 Nov 19, 2013
console.save - A simple way to save objects as .json fle from the console // original: http://bgrins.github.io/devtools-snippets/#console-save
View console.save.js
(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 Dec 1, 2013
function-name - Get the name of a named function
View function-name.js
/*!
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.');
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