Skip to content

Instantly share code, notes, and snippets.

View joshbuchea's full-sized avatar

Josh Buchea joshbuchea

View GitHub Profile
@mathetos
mathetos / ssl-for-images.php
Last active July 3, 2018 08:21
Force http/s for images in WordPress
/**
*
* Force http/s for images in WordPress
*
* Source:
* https://core.trac.wordpress.org/ticket/15928#comment:63
*
* @param $url
* @param $post_id
*
@apettinen
apettinen / gist:701688cc64881a1ae1c1
Last active October 18, 2018 23:37
Getting on track with Office2016 licensing

This gist gives a short outline of how to get back on track with Office 2016 licensing if you have been using the Combo Update packages available via AutoPKG to distribute Office 2016 applications and thus copying the Office license file around.

  1. download an installer package from http://macadmins.software (e.g. Word Standalone installer)

  2. extract the LauncDaemon and PrivilegedHelperTool from the installer package (e.g. by running the installer on a VM):

  • /Library/LaunchDaemons/com.microsoft.office.licensingV2.helper.plist
  • /Library/PrivilegedHelperTools/com.microsoft.office.licensingV2.helper
  1. package the abovementioned two files
@matthargett
matthargett / ts-vs-flow.md
Created November 19, 2018 21:00
TypeScript versus flowtype

First, let's note the difference in philosophy: TypeScript aims for fast analysis because you can to compile it down to JS before you can run/test it. flowtype is meant to be an async analysis that can run continuously with changes since the last analysis, or in parallel with your eslint and bundler rules. As such, flowtype's type system and analysis is not quite as concerned with speed or memory usage in service of potentially finding more bugs.

On two occasions I have tried to roll out flow in React Native applications, and on those two occasions we ended up backing out after a few weeks. Some detail: flow doesn't have a public roadmap, and what version you use is dictated by the react/react-native dependency and the annotations in react-native itself. flowtype also has some hard-coded aspects to help the analysis for React, so major updates to React itself sometimes also require updating flowtype to match. React Native upgrades then get gated based on your dependent libraries (or flow-typed) being updated

/** @jsx React.DOM */
var MyComponent = React.createClass({
render: function() {
// Defaults in case the props are undefined. We'll have a solution for this
// soon that is less awkward.
var perMinute = this.props.perMinute || '-';
var perDay = this.props.perDay || '-';
return (
<div>
<h3>Clickouts</h3>
@cmmartin
cmmartin / moment-filter.js
Last active July 31, 2019 09:01
A generic Moment.js date filter for Angular.js
// REQUIRES:
// moment.js - http://momentjs.com/
// USAGE:
// {{ someDate | moment: [any moment function] : [param1] : [param2] : [param n]
// EXAMPLES:
// {{ someDate | moment: 'format': 'MMM DD, YYYY' }}
// {{ someDate | moment: 'fromNow' }}
@cowboy
cowboy / jsonp.php
Created September 7, 2011 14:28
JSONP "callback" param explanation, via basic PHP script.
<?PHP
# JSONP "callback" param explanation, via basic PHP script.
#
# "Cowboy" Ben Alman
# http://benalman.com/
# Set $data to something that will be serialized into JSON. You'll undoubtedly
# have your own code for this.
$data = array("some_key" => "some_value");
@Urbiwanus
Urbiwanus / gist:c1e456f889f53e940a11
Last active November 13, 2019 15:38
Cordova Paypal Integration AngularJS
app.factory('PaypalService', ['$q', '$ionicPlatform', 'shopSettings', '$filter', '$timeout', function ($q, $ionicPlatform, shopSettings, $filter, $timeout) {
var init_defer;
/**
* Service object
* @type object
*/
var service = {
@ttscoff
ttscoff / Jekyll Filer.rb
Last active April 18, 2020 19:15
OS X System Service script for filing Jekyll images and putting Markdown links on the clipboard
require 'fileutils'
# An OS X System Service for quickly filing image files to a Jekyll blog folder,
# putting Markdown links to the files on the clipboard.
# Copyright Brett Terpstra 2013
# Config
# ======
# Where to store the images
base_path = '~/Sites/dev/octopress/source/uploads/'
@sugarmo
sugarmo / json-to-plist.sh
Last active December 6, 2020 03:06
A shell script for Automator that can convert JSON to .plist file.
for f in "$@"
do
filename="${f%.*}"
plutil -convert xml1 "$filename".json -o "$filename".plist
done
@rafaelrinaldi
rafaelrinaldi / README.md
Last active January 22, 2021 09:04
`.mov` to `.gif` using QuickTime and Photoshop

.mov to .gif using QuickTime and Photoshop

This is my prefered way to create GIF animations for demos and whatnot.

Steps

  1. QuickTime » File » New Screen Recording
  2. Select area to record » Start recording your thing
  3. File » Export » Select max resolution available » Save
  4. Photoshop » Import » Video Frames to Layers (no need to follow step 2 if not on retina screen)