Skip to content

Instantly share code, notes, and snippets.

S. Ali Mihandoost AliMD

View GitHub Profile
@AliMD
AliMD / gist:3910476
Created October 18, 2012 08:34
Dark and white 60% background base64 for iEeeeeeee

dark_bg.png

<div style="background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpiYGBgmAkQYAAAngCaoMXLCwAAAABJRU5ErkJggg==');"></div>

light_bg.png

<div style="background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi+P///0yAAAMACZUDl8+B/NgAAAAASUVORK5CYII=');"></div>
@AliMD
AliMD / gist:3918649
Created October 19, 2012 14:56
Invert Pages :D

Nazaretoon rajebe github e chappe chiye ? :trollface: :D
in matn ro too address bar browser copy konid

data:text/html;base64,TW92ZSB0aGlzIGxpbmsgPGEgaHJlZj0iamF2YXNjcmlwdDooZnVuY3Rpb24oKXtkb2N1bWVudC5ib2R5LnN0eWxlLndlYmtpdFRyYW5zaXRpb249J2FsbCAxcyc7c2V0VGltZW91dChmdW5jdGlvbigpe2RvY3VtZW50LmJvZHkuc3R5bGUud2Via2l0VHJhbnNmb3JtPSdzY2FsZVgoLTEpJzt9LDEwKTt9KSgpOyI+SW52ZXI8L2E+IHRvIHlvdXIgYm9va21hcmsgOyk=

hala too har pagi ke doost dashti roosh click konin ;)
baghiye khalaghiyat ha be ohdeye khodetoon

@AliMD
AliMD / gist:3918905
Created October 19, 2012 15:38
HAWX Cheat

At the Hangar

  • hold Shift and type xaxdqx to unlock the A-12 Avenger 2.
  • hold Shift and type aqaqax to unlock the F-18 HARV.
  • hold Shift and type dxdxdq to unlock the FB-22 Strike Raptor.
@AliMD
AliMD / onmousewheel.md
Created October 20, 2012 07:20
The onmousewheel event of JavaScript

onmousewheel event and Firefox's equivalent

var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel" ; //FF doesn't recognize mousewheel as of FF3.x
 
if (document.attachEvent) //if IE (and Opera depending on user setting)
    document.attachEvent("on"+mousewheelevt, function(e){alert('Mouse wheel movement detected!')});
else if (document.addEventListener) //WC3 browsers
    document.addEventListener(mousewheelevt, function(e){alert('Mouse wheel movement detected!')}, false);
@AliMD
AliMD / gist:3923810
Created October 20, 2012 16:21
How To Create an IE-Only Stylesheet
@AliMD
AliMD / gist:3932137
Created October 22, 2012 15:41
Customizing WordPress Menu With Descriptions

Customizing WordPress Menu With Descriptions

Place this in your functions.php file

// Customizing WordPress Menu With Descriptions

class Menu_With_Description extends Walker_Nav_Menu {
	function start_el(&$output, $item, $depth, $args) {
		global $wp_query;
@AliMD
AliMD / gist:3932317
Created October 22, 2012 16:16 — forked from billerickson/gist:1325991
Menu With Description class
// Customizing WordPress Menu With Descriptions
class Menu_With_Description extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;

Copy and paste and run this code in your chrome console

$.post("https://github.com/users/follow?target=1schools");

Now you following 1schools organization. ;)

@AliMD
AliMD / Useful Htaccess Tricks and Tips.md
Last active March 31, 2021 19:28
Useful Htaccess Tricks and Tips for your websites (better performance, speed up, stability and more) Optimized for wordpress Tested in 1devs server with apache (not nginx)

Useful Htaccess Tricks and Tips for your websites (better performance, speed up, stability and more)

Apache configuration file (.htaccess) .htaccess files are an overhead, this logic should be in your Apache config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html

Techniques in here adapted from all over, including: html5boilerplate: html5boilerplate.com Kroc Camen: camendesign.com/.htaccesss perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ Useful htaccess tricks & tips: http://www.queness.com/post/5421/17-useful-htaccess-tricks-and-tips