Skip to content

Instantly share code, notes, and snippets.

View andypotanin's full-sized avatar
🇺🇲
Focusing

Andy Potanin andypotanin

🇺🇲
Focusing
View GitHub Profile
/**
*
*/
(function(doc, require, _) {
//console.log( 'extend-with-title.js', require( 'util' ).inspect( arguments[0], { showHidden: false, depth: 2, colors: true } ) );
_.extend( doc, {
'new_title': 'modified title again!!'
});
{
"title": "Layouts Directory",
"items": [
{
"id": "beautifully-baked",
"slug": "beautifully-baked",
"title": "Beautifully Baked",
"description": "",
"preview": "http://layouts.siteorigin.com/layout/beautifully-baked/",
"screenshot": "http://s.wordpress.com/mshots/v1/http%3A%2F%2Flayouts.siteorigin.com%2Flayout%2Fbeautifully-baked%2F?w=400",
@andypotanin
andypotanin / git-deploy.sh
Created October 21, 2016 07:06
Put into a directory that is in $PATH. Then run "git deploy {branch}" to push current branch into it.
#!/usr/bin/env bash
## Deploy branch into "develop" branch
##
## Usage:
##
## git deploy production
##
## Save Original Branch
#!/bin/bash
##
## curl -s -H "cache-control:no-cache" -H "pragma:no-cache" "https://gist.githubusercontent.com/andypotanin/83910a6477effe3f9e1186784c2a7206/raw/coreos.cloudinit.sh?v=1" | sudo bash;
METADATA_URL="http://169.254.169.254/computeMetadata/"
TMPFILE=$(mktemp /tmp/XXXXXX-cloud-init)
if [[ $? -ne 0 || ! -f "${TMPFILE}" ]]; then
echo "Failed to create temp file for user-data" >&2
exit 1
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
## export _REPO_FULL=UsabilityDynamics/www.exceedrealty.net
## curl -s --header "Authorization: token ${GITHUB_PERSONAL_TOKEN}" https://api.github.com/repos/${_REPO_FULL}/labels
# Delete default labels
curl -XDELETE -s --header "Authorization: token ${GITHUB_PERSONAL_TOKEN}" https://api.github.com/repos/${_REPO_FULL}/labels/bug
# Create New Labels
curl -XPOST -s --header "Authorization: token ${GITHUB_PERSONAL_TOKEN}" https://api.github.com/repos/${_REPO_FULL}/labels --data '{"name":"priority:low","color":"66aa00"}'
/**
* Explain What Middleware/Route does.
*
* @author potanin@UD
* @param req
* @param res
* @param next
* @returns {*}
*/
function myMiddleware( req, res, next ) {
{
"ok": true,
"data": [
{
"post_title": "Result A",
"post_excerpt": "Result A excerpt"
},
{
"post_title": "Result B",
"post_excerpt": "Result B excerpt"
<?php
// Only activate tests when on a 'develop' branch.
if( isset( $_SERVER['HTTP_X_SELECTED_BRANCH'] ) && strpos( $_SERVER['HTTP_X_SELECTED_BRANCH'], 'develop' ) !== false ) {
header( 'cache-control:no-cache, private' );
$_event_map = array(
"init" => [ 5, 10, 20 ],
"after_setup_theme" => [ 5, 10, 20 ],
"plugins_loaded" => [ 5, 10, 20 ],
(function () {
var root = jQuery(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function (watcher) {
watchers.push(watcher);
});
}