Skip to content

Instantly share code, notes, and snippets.

View andypotanin's full-sized avatar
🇺🇲
Focusing

Andy Potanin andypotanin

🇺🇲
Focusing
View GitHub Profile
#!/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 <spearce@spearce.org>
# 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);
});
}
@andypotanin
andypotanin / git-deploy
Created May 9, 2016 10:45
Add this to your binary path to deploy things into "latest" branch quickly.
#!/usr/bin/env bash
## Deploy branch into "develop" branch
##
## Save Original Branch
ORIGINAL_BRANCH=$(git symbolic-ref --short HEAD)
echo "Deploying [${ORIGINAL_BRANCH}] into [latest]."
*.log
*.sql
sitemap.xml
sitemap.xml.gz
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
{
"additional_room” {
“default”: “LFD_ROOMADDITIONAL_29”
“type”: “string”,
“multiple”: true,
“delimiter”: “,”
“values”: {
“Kitchen”: “Kitchen/Family Combo”,
“Dining Room”: “Formal Dining Room"
}