Skip to content

Instantly share code, notes, and snippets.

View neoswf's full-sized avatar
🏠
Working from home

Shlomi Asaf neoswf

🏠
Working from home
View GitHub Profile

Disable WordPress.com admin Toolbar, using a micro plugin

Please avoid instaling bloated plugins. No need for Code Snippets plugins, when you can create this micro plugin by yourself, and install it on your site, and always enabling and disabling the plugin, as much you would wish for!

How to use this plugin?

  1. Do not install Code Snippets on your site! Its expensive and a waste of time, when you can create your own "code snippets"!
  2. Create a folder inside your plugins folder. Name it Disable Jetpack's Admin-bar.
  3. Copy into it the file inside this gist.
  4. Upload the folder to your site's plugins folder.
@neoswf
neoswf / mixins.scss
Last active August 29, 2015 14:21
golden mixins
//background RGBA com IE Support!!!
@mixin rgba-background($color, $alpha) {
$rgba: rgba($color, $alpha);
$ie-hex-str: ie-hex-str($rgba);
background-color: transparent;
background-color: $rgba;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str});
zoom: 1;
}
@neoswf
neoswf / gist:02d66dadbfef56f0254c
Last active August 29, 2015 14:06
How to catch an error event for an SVG image
<!--
Image is a 87px height & 200px width long.
I'm calling an image from DB, but if it fails to load, im listening to the Error event, and than call an image from DB.
Big thing here is this guy: `onerror="this.href.baseVal='pathTo_placeholder_fallback_image'"`
`this.href.baseVal`
This guy enables you to overright the SVG image source, with the fallbacl one.
-->
@neoswf
neoswf / gist:3416628
Created August 21, 2012 15:32
Find matches in two arrays
mainList = [-11, -1, 1, 2, 3, 4, 5];
toSearchList = [-1, 1, 4, 6];
document.write('Indexs inside mainList: ');
for (var i = 0; i < mainList.length; i++) {
for (var y = 0; y < toSearchList.length; y++) {
if(mainList[i] == toSearchList[y]){
document.write(i + ', ');
}