Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ryan Haywood haywoood

🏠
Working from home
Block or report user

Report or block haywoood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@haywoood
haywoood / gist:4540930
Created Jan 15, 2013
Command to load postgres .dump file to local development db
View gist:4540930
turn this into a script
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U rhaywood -d flp_development latest.dump
View gist:4562294
{
"application_id":"2TTTAcpaL9tMD9e7NFvaMzQ",
"src":"https://s3.amazonaws.com/barbour/uploads/3254_Barbour___Paul_Smith_Lookbook_LR.pdf",
"src_type":{"name" : "multi_page", "pages" : [0]},
"functions":[
{
"name":"resize_to_fit",
"params":{
"width":220,
"height":155
View file_uploader.rb
class FileUploader < CarrierWave::Uploader::Base
require 'carrierwave/processing/mini_magick'
include CarrierWave::MiniMagick
storage :fog
version :thumb do
process :resize_first_page
process :convert => :jpg
@haywoood
haywoood / gist:4609046
Created Jan 23, 2013
Vegan burrito order from chipotle
View gist:4609046
Can I get a Burrito with cilantro lime rice, black beans, fajita vegetables, mild salsa, and extra guac.
View store.coffee
serializer = DS.JSONSerializer.create()
serializer.configure 'App.Model',
sideloadAs: 'models'
App.RestAdaptor = DS.RESTAdapter.extend
serializer: serializer
App.Store = DS.Store.extend
adapter: App.RestAdaptor
View app.coffee
window.App = Ember.Application.create
rootElement: '.solution_products_documents'
##
# MODELS / EMBER-DATA
##
serializer = DS.JSONSerializer.create()
serializer.configure 'App.Document',
View product.hbs
<div class="row">
<div class="twelve columns">
<h2>{{title}} - Assets</h2>
</div>
</div>
<div class="row">
<div class="three columns">
<ul>
{{#each assetTypes}}
{{#linkTo 'product.filter' this}}{{title}}{{/linkTo}}
View gist:5422503
100% of Global Fortune 100 companies trust VMware to power their virtualized environments, and more of those deployments run on HP infrastructure than any other platform.
To learn more about virtualization and cloud solutions from VMware and HP, please visit these websites.
<p><a href="http://vmware.com/go/cloud">vmware.com/go/cloud</a></p>
<p><a href="http://vmware.com/go/virtualization">vmware.com/go/virtualization</a></p>
<p><a href="http://vmware.com/go/HP">vmware.com/go/HP</a></p>
<p><a href="http://hp.com/go/vmware">hp.com/go/vmware</a></p>
<p><a href="http://hp.com/go/cloud">hp.com/go/cloud</a></p>
<p><a href="http://hp.com/go/virtualization">hp.com/go/virtualization</a></p>
View gist:6992375
(def primes
(concat
[2 3 5 7] (lazy-seq
(let [primes-from
(fn primes-from [n [f & r]]
(if (some #(zero? (rem n %))
(take-while #(<= (* % %) n) primes))
(recur (+ n f) r)
(lazy-seq (cons n (primes-from (+ n f) r))))) wheel(cycle[24246264246626 4 2 64684242486462 4 6
2 6 6 4 2 4 6 2 6 4 2 4 2 10 2 10])]
View gist:7015834
(ns bare.core
(:require
[clojure.string :as s :refer [join]]
[cljs.core.async :as async :refer [<! >! chan timeout put!]]
[dommy.utils :as utils]
[dommy.core :as dommy])
(:use-macros
[dommy.macros :only [node sel sel1 deftemplate]])
(:require-macros [cljs.core.async.macros :as m :refer [go]]))
You can’t perform that action at this time.