Skip to content

Instantly share code, notes, and snippets.

@ziogaschr
ziogaschr / js-load-multiple-3rd-party-widgets-async.js
Last active December 15, 2015 13:49 — forked from zenorocha/multiple-3rd-party-widgets.js
JS: Load Multiple 3rd party widgets async
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
{
"scope": "source.js -string -comment -constant",
"completions": [
{ "trigger": "customtrigger.allowBlank\tBoolean", "contents": "allowBlank: $1${2:,}" },
{ "trigger": "customtrigger.allowOnlyWhitespace\tBoolean", "contents": "allowOnlyWhitespace: $1${2:,}" },
{ "trigger": "customtrigger.blankText\tString", "contents": "blankText: '$1'${2:,}" },
{ "trigger": "customtrigger.checkChangeBuffer\tNumber", "contents": "checkChangeBuffer: $1${2:,}" },
{ "trigger": "customtrigger.checkChangeEvents\tString[]", "contents": "checkChangeEvents: ['$1']${2:,}" },
{ "trigger": "customtrigger.dirtyCls\tString", "contents": "dirtyCls: '$1'${2:,}" },
@ziogaschr
ziogaschr / LUA-cURL fetch file in memory
Last active December 19, 2015 00:09
LUA: luacurl, fetch a file in memory
require("luacurl")
local c = curl.new()
function GET(url)
-- c:setopt(curl.OPT_VERBOSE, true) -- run curl in verbose mode
c:setopt(curl.OPT_URL, url)
c:setopt(curl.OPT_HEADER, true)
c:setopt(curl.OPT_CONNECTTIMEOUT, 3)
@ziogaschr
ziogaschr / wp-remove-junk-from-wphead-section.php
Last active December 26, 2015 23:19 — forked from tsevdos/remove-junk-from-wphead-section.php
WP: Remove junk from wphead in WordPress
// remove junk from head
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
@ziogaschr
ziogaschr / css-add-noise-filter.css
Created November 9, 2013 12:46
CSS: adds noise filter by using a base64 background image
.noise {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiW
#!/usr/bin/env bash
# file: ~/.virtualenvs/postmkvirtualenv
# This hook is run after a new virtualenv is activated.
# setup python interpretor and sitepackages
# for Sublime Text's SublimeCodeIntel plugin.
# codeintel looks in the root of any folder opened via `subl foldername`
# for foldername/.codeintel/config
# it also looks in ~/.codeintel/config
#!/bin/sh
# Disable BT on local machine and enable it on remote machine, so KB/Mouse reconnect to remote machine.
#ensure local bluetooth is off
/usr/local/bin/blueutil off
#enable imac bluetooth
ssh destiny@Chriss-iMac.local '/usr/local/bin/blueutil on'
@ziogaschr
ziogaschr / js_add_to_cart_popup.js
Last active December 30, 2015 11:19
JS: Force showing a popup video to user before adding item to cart
/**
* Force showing a popup video to user before adding item to cart
* Use Case: Stokke Tripp-Trapp
*/
$(document).ready(function () {
var success_hash = 'tripptrapp-success';
// check if this is the success page
if(window.location.hash.substring(1) == success_hash) {
@ziogaschr
ziogaschr / Sass-mixins.scss
Created June 13, 2014 16:26
SASS: basic mixins
// by Chris Coyier, Some Mini Sass Mixins I Like
// http://codepen.io/chriscoyier/blog/some-mini-sass-mixins-i-like
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}