This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :theme_path, Pathname.new('web/app/themes/my_wp_theme') | |
set :local_app_path, Pathname.new('/Applications/MAMP/htdocs/my_wp_app') | |
set :local_theme_path, fetch(:local_app_path).join(fetch(:theme_path)) | |
namespace :deploy do | |
task :compile_assets do | |
run_locally do | |
within fetch(:local_theme_path) do | |
execute :grunt, :build | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Roots theme by default does not check production assets into Git, so | |
# they are not deployed by Capistrano when using the Bedrock stack. The | |
# following will compile and deploy those assets. Copy this to the bottom of | |
# your config/deploy.rb file. | |
# Based on information from this thread: | |
# http://discourse.roots.io/t/capistrano-run-grunt-locally-and-upload-files/2062/7 | |
# and specifically this gist from christhesoul: | |
# https://gist.github.com/christhesoul/3c38053971a7b786eff2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps xmo rss=,pmem=,comm= | while read rss pmem comm; ((n++<5)); do | |
size="$[rss/1024]"; | |
short=$[4-${#size}]; | |
size="(${size}M)"; | |
i=0; | |
while ((i++ < short)); do size=" $size"; done; | |
pmem="${pmem%%.*}" | |
if (($pmem >= 20)); then color=$'\e[31m'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes. | |
* | |
* <p>Because Wordpress generates all image sizes on first upload, if you change | |
* theme or size settings after the upload, there won't be a matching file for | |
* the requested size.<br/> | |
* This filter addresses the problem of the default downsize process laoding | |
* a large file and scaling it down in the browser if it doesn't find the right | |
* size image. This can cause large files to be loaded unnecessarily and will |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('wordpress', []) | |
.service( 'wpService', | |
function($http, $q){ | |
var url = 'http://allin.local/wp-json/'; | |
return({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('print-broadcasts', []).config(['$provide', function ($provide) { | |
$provide.decorator('$rootScope', function ($delegate) { | |
var _emit = $delegate.$emit; | |
var _broadcast = $delegate.$broadcast; | |
$delegate.$emit = function () { | |
console.log("[$emit] " + arguments[0] + " (" + JSON.stringify(arguments) + ")"); | |
return _emit.apply(this, arguments); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: wp-audit [options] | |
# -a, --all-plugins Show all plugins, not just outdated ones | |
# -c, --[no-]color Highlight outdated versions in colour | |
# -f, --format [format] Specify output format. Accepted values: html, term (Terminal output and colours), md (Markdown, no colours). term is default. | |
# | |
# Requires: Ruby >= 2.0; a Unix-like operating system (one that ships | |
# with `find`, `less`, and `diff`) | |
# | |
# Installation: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Himawari-8 Downloader | |
# | |
# | |
# | |
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image, | |
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background. | |
# | |
# http://himawari8.nict.go.jp/himawari8-image.htm | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
from datetime import datetime, timedelta | |
import pytz | |
from PIL import Image | |
from StringIO import StringIO | |
import os | |
import logging | |
# python himawari.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
console.log('Loading function'); | |
var https = require('https'); | |
var PAGE_TOKEN = "EAASI6Z**********<fb tokenKey>"; | |
var VERIFY_TOKEN = "my_awesome_token"; | |
/** | |
* Provide an event that contains the following keys: | |
* |