Skip to content

Instantly share code, notes, and snippets.

javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@wgm89
wgm89 / git.migrate
Last active February 15, 2017 10:05 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@wgm89
wgm89 / git.migrate
Created February 15, 2017 10:04 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@wgm89
wgm89 / gist:23e8740fbe9221e174eb6de7598ebfc6
Created January 13, 2017 07:38 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@wgm89
wgm89 / object-watch.js
Created December 13, 2016 06:30 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@wgm89
wgm89 / jquery.ajaxqueue.js
Created December 13, 2016 06:30 — forked from extralam/jquery.ajaxqueue.js
jQuery AJAX queues
/*
:: Enhanced Version @extralam ::
Allows for ajax requests to be run synchronously in a queue , remove queue
Usage::
var queue = new $.AjaxQueue();
// add with tag name or not , both ok
queue.add('test',{
url: 'url',
@wgm89
wgm89 / UUID.php
Last active August 29, 2015 14:13 — forked from dahnielson/UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
function loadModel($type, $id, $errorMessage='This page does not exist', $errorNum=404)
{
$model = CActiveRecord::model($type)->findByPk($id);
if ($model === null)
throw new CHttpException($errorNum, $errorMessage);
return $model;
}
//This is how HTML, Controller & Directive looked in my actual app at this point.
//Notice that we are applying masonry for every element as they are added by ng-repeat.
//HTML
/*
<div id="photoContainer" style="position:relative;height:800px;zoom:1;">
<div class="photo" ng-repeat="photoPost in photoPosts">
<img ng-src="{{photoPost.photo.url}}" add-masonry="photoPost"></div>
</div>
</div>
@wgm89
wgm89 / simpleimage.php
Created November 30, 2012 03:52 — forked from miguelfrmn/simpleimage.php
SimpleImage PHP Class
<?php
/*
* File: SimpleImage.php
* Author: Simon Jarvis
* Modified by: Miguel Fermín
* Based in: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2