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
# Loosely based on https://www.fpcomplete.com/blog/2017/12/building-haskell-apps-with-docker | |
FROM fpco/stack-build:lts-13.27 as dependencies | |
RUN mkdir /opt/build | |
WORKDIR /opt/build | |
# GHC dynamically links its compilation targets to lib gmp | |
RUN apt-get update \ | |
&& apt-get download libgmp10 | |
RUN mv libgmp*.deb libgmp.deb |
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
//The fun solution: using array methods | |
var ary = []; | |
for(var i = 1; i <= 1000; i++){ ary.push(i); } | |
console.log( | |
ary.filter(function(item){ | |
return (item % 3 == 0 || item % 5 == 0) | |
}).reduce(function(memo, current){ | |
return memo + current | |
}, 0) | |
); |
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 subprocess | |
import sys | |
from subprocess import PIPE, Popen | |
import os | |
__all__ = ( | |
'build', | |
'endode', | |
'decode', | |
) |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
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
events = | |
events: {} | |
bind: (topic, handler, context = this) -> | |
(@events[topic] ||= []).push { handler, context } | |
trigger: (topic, args...) -> | |
if @events[topic]? | |
event.handler.apply event.context, args for event in @events[topic] |
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
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
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
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery | |
set nocompatible | |
set autoindent | |
set tabstop=2 | |
set showmatch | |
set vb t_vb= | |
set ruler | |
set nohls | |
set incsearch | |
syntax on |
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 fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and you're using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
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
#!/usr/bin/env ruby | |
%w(rubygems grit json pathname).each{|d| require d} | |
# Aside from removing Ruby on Rails specific code this is taken verbatim from | |
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome | |
# - Ryan Florence (http://ryanflorence.com) | |
# | |
# Install this hook to a remote repository with a working tree, when you push | |
# to it, this hook will reset the head so the files are updated | |
if ENV['GIT_DIR'] == '.' |