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 { withScalars } from 'apollo-link-scalars' | |
import { buildClientSchema, IntrospectionQuery } from 'graphql' | |
import introspectionResult from '../graphql/schema.json' | |
const typesMap = { | |
ISO8601DateTime: { | |
serialize: (parsed: any) => parsed && parsed.toISOString(), | |
parseValue: (raw: any) => raw && new Date(raw), | |
}, |
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
// Create a queue to push events and stub all methods | |
window.analytics || (window.analytics = {}); | |
window.analytics_queue || (window.analytics_queue = []); | |
(function() { | |
var methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off']; | |
var factory = function(method) { | |
return function () { | |
var args = Array.prototype.slice.call(arguments); | |
args.unshift(method); |
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
:root { | |
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif; | |
--font-size: 16px; | |
--primary-color: #0074d9; | |
--primary-color-dark: #005cad; | |
} | |
* { | |
box-sizing: border-box; | |
} |
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 _ from 'lodash' | |
function deepMapKeys(obj, fn) { | |
if (_.isArray(obj)) { | |
return _.map(obj, (v) => deepMapKeys(v, fn)) | |
} | |
if (_.isPlainObject(obj)) { | |
let newObj = {} |
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
$ = jQuery | |
$.fn.extend | |
plugin: (options) -> | |
settings = | |
debug: true | |
settings = $.extend settings, options | |
log = (msg) -> |
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
task :rename do | |
Dir.glob('*.mp3') do |file| | |
new_name = file.gsub(" ", '_').gsub(/'/, '') | |
File.rename(file, new_name) | |
puts new_name | |
end | |
end | |
task :transcode do | |
Dir.glob('*.mp3') do |file| |
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
module Dragonfly | |
module Endpoint | |
def success_headers(job) | |
{ | |
"Content-Type" => job.app.resolve_mime_type(job.result), | |
"Content-Length" => job.size.to_s, | |
"Content-Disposition" => "filename=#{job.name}" | |
}.merge(cache_headers(job)) | |
end |
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 'net/http' | |
def check_response(response, expected) | |
raise "Unexpected response from server: #{response.code} #{response.message}" unless response.is_a?(expected) | |
end | |
def get_actual_download_url(download_url) | |
puts "requesting #{download_url}" | |
url = URI.parse(download_url) | |
response = Net::HTTP.start(url.host, url.port) { |http| http.get(url.path) } |
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
namespace :bundler do | |
task :create_symlink, :roles => :app do | |
shared_dir = File.join(shared_path, 'bundled_gems') | |
release_dir = File.join(current_release, 'vendor', 'bundle') | |
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}") | |
end | |
task :bundle_new_release, :roles => :app do | |
bundler.create_symlink | |
run "cd #{release_path} && bundle install --deployment" |
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
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |