Skip to content

Instantly share code, notes, and snippets.

View roose's full-sized avatar
🐢
Looking for a job

roose roose

🐢
Looking for a job
View GitHub Profile
//! v.1.2.1, http://ilyabirman.net/projects/emerge/
if (jQuery) {
!function($) {
$(function() {
/**
* @param {Element} obj
* @return {?}
*/
$.expr[":"].uncached = function(obj) {
if (!$(obj).is('img[src!=""]')) {
//! v.1.2.1, http://ilyabirman.net/projects/emerge/
jQuery&&(!function(t){t(function(){t.expr[":"].uncached=function(a){if(!t(a).is('img[src!=""]'))return!1;var e=new Image;return e.src=a.src,!e.complete};var a=[],e=500,i=!1,r=!1,o=["backgroundImage","borderImage","borderCornerImage","listStyleImage","cursor"],n=/url\(\s*(['"]?)(.*?)\1\s*\)/g,s=0,d=function(t,a,e,i,r){var o="emergeRotate"+ ++s;return'<div style="position: absolute; transition: opacity '+r+'ms ease-out"><div style="position: absolute; left: 50%; top: 50%; margin: -'+t+'px"><svg xmlns="http://www.w3.org/2000/svg" width="'+2*t+'" height="'+2*t+'"viewBox="0 0 24 24" style="-webkit-animation: '+o+" "+i+"ms linear infinite;animation: "+o+" "+i+'ms linear infinite"><path fill="'+a+'" d="M17.25 1.5c-.14-.06-.28-.11-.44-.11-.55 0-1 .45-1 1 0 .39.23.72.56.89l-.01.01c3.2 1.6 5.39 4.9 5.39 8.71 0 5.38-4.37 9.75-9.75 9.75S2.25 17.39 2.25 12c0-3.82 2.2-7.11 5.39-8.71v-.02c.33-.16.56-.49.56-.89 0-.55-.45-1-1-1-.16 0-.31.05-.44.11C2.9 3.43.25 7.4.25 12c0 6.4
@Tblue
Tblue / mozlz4a.py
Last active March 30, 2024 08:45
MozLz4a compression/decompression utility
#!/usr/bin/env python3
# vim: sw=4 ts=4 et tw=100 cc=+1
#
####################################################################################################
# DESCRIPTION #
####################################################################################################
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
@beshur
beshur / hsb.scss
Created November 14, 2014 09:45
Sass: HSB to HSL converter
// Simple HSB to HSL converter by Alexander Futekov (@futekov)
// http://www.sitepoint.com/hsb-colors-with-sass/
//
@function hsb($h-hsb, $s-hsb, $b-hsb, $a: 1) {
@if $b-hsb == 0 {
@return hsla(0, 0, 0, $a)
} @else {
$l-hsl: ($b-hsb/2) * (2 - ($s-hsb/100));
$s-hsl: ($b-hsb * $s-hsb) / if($l-hsl < 50, $l-hsl * 2, 200 - $l-hsl * 2);
@return hsla($h-hsb, $s-hsl, $l-hsl, $a);
@fabrizim
fabrizim / acf-customizer-patch.php
Last active January 17, 2024 02:30
Plugin to allow for Advanced Custom Fields to be used in widgets within the Customizer
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@bueltge
bueltge / post-process.php
Created June 24, 2011 21:08
WordPress Custom Post Type: Insert post via Frontend
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']
@derpixler
derpixler / wp-coustom-term-options.php
Created May 25, 2011 07:02
Wordpress Hooks to add coustom term Options
<?php
/**
*
* Add only for parents coustom term Options
* @author rene reimann
* @home http://www.rene-reimann.de
*
* @hook category_add_form_fields Hooks into the category edit page
* @hook edit_tag_form_fields Hooks into the category frontpage
@miya0001
miya0001 / switchTheme.php
Created May 10, 2011 19:39
switch theme class for wordpress plugin
<?php
class switchTheme {
private $name = null;
private $dir = null;
private $url = null;
function __construct($name = null, $dir = null, $url = null)
{
$this->name = $name;