This file contains 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
#!/bin/bash -e | |
# REQUIREMENTS | |
# * jq - Used to extract values from notary service JSON responses | |
# * curl - Used to query notary service | |
signing_identity="Developer ID Installer: Your Name (ID)" | |
username="user@example.com" | |
password="@keychain:where-you-stored-your-app-specific-password" | |
output_dir=~/your_output_directory |
This file contains 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
defmodule Mix.Tasks.Deps.Licenses do | |
alias Mix.Dep | |
use Mix.Task | |
@shell Mix.shell() | |
def run(_) do | |
Mix.Project.get!() | |
{with_licenses, without_licenses} = |
This file contains 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 React, {Component, Children} from 'react' | |
import {connect} from 'react-redux' | |
const MODAL_CHANGE = 'MODAL_CHANGE' | |
// Maintain a single active modal identifier | |
export function modalReducer(state = {activeModalId: null}, {type, id}) { | |
if(type !== MODAL_CHANGE) { | |
return state | |
} |
This file contains 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 React, {Component, PropTypes, Children, createElement} from 'react' | |
const CONTEXT_NAME = '__uniqueIDFunction__' | |
const CONTEXT_TYPES = {} | |
CONTEXT_TYPES[CONTEXT_NAME] = PropTypes.func | |
function createUniqueIDFunction() { | |
let counter = 0 | |
return function() { | |
return ++counter |
This file contains 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' | |
const reactDocs = require('react-docgen') | |
const dir = require('node-dir') | |
export default function walkReactComponentFiles(path, pattern, handleFilename, done) { | |
const iterator = function(error, content, filename, next) { | |
if(error) { | |
throw error | |
} |
This file contains 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
# This plug takes HTML requests, forwards them to our controllers as JSON | |
# requests, takes the resulting JSON and POSTs it to a rendering service, | |
# then transforms the response back into HTML using the output from the | |
# rendering service. | |
# | |
# Which means we can write our probably-JavaScript/React view layer | |
# independently of Phoenix tooling. | |
defmodule ServiceRenderer do | |
# Base URL of render service goes here. | |
def init(url) do |
This file contains 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
var webpack = require('webpack'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var deepMerge = require('deep-merge'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
// BEGIN CONFIG TOOLS | |
// Set up config merging function. | |
var merge = deepMerge(function(target, source, key) { |
This file contains 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
// Stupid JavaScript and console tricks. | |
// Trap and record console things and errors. | |
function MosquitoNet() {} | |
MosquitoNet.history = []; | |
MosquitoNet.writeHistory = function(type, args) { | |
MosquitoNet.history.push({ type: type, args: args }); | |
} | |
MosquitoNet.shadowConsoleFunction = function(name) { | |
var oldFn = console[name]; |
This file contains 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
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(*Rails.groups) | |
module MyProject | |
class Application < Rails::Application |
This file contains 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
require 'faraday' | |
class WordpressController < ApplicationController | |
@@wp_client = Faraday.new(url: "http://#{ENV['WP_DOMAIN']}") do |builder| | |
builder.adapter Faraday.default_adapter | |
builder.headers = {'Content-Type' => 'application/json'} | |
builder.request :url_encoded | |
end |
NewerOlder