Skip to content

Instantly share code, notes, and snippets.

# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@delitescere
delitescere / project.clj
Last active June 23, 2017 01:26
Mostly Java-based lein project with JUnit and Log4J2 (main.clj is still entry point)
(defproject com.example/foo "0.1.0"
:description "Does fooness"
:url "http://example.com/"
:license {:name "Copyright ©2014 Josh Graham"}
:aliases {"dist" ["do" ["clean"] ["test"] ["uberjar"]] ;$ lein dist # create distribution JAR
"debug" ["with-profile" "dev,debug" "run"]} ;$ lein debug # run for a 'remote' debugger
:aot :all
:auto-clean false ;"dist" alias does the full cycle
:clean-targets ^{:protect false} [:target-path :junit-results-dir]
:dependencies [
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@snewman
snewman / ansible_fireball_setup
Created July 15, 2013 00:45
This got ansible's fireball mode working for me from a clean Ubuntu 12.04 AWS instance. The tricky thing is that you will also need these dependencies deployed locally too - otherwise you'll get errors about zmq not being deployed. Currently, Ansible doesn't say if the missing dependency is on the server or client, which caused me much angst!
---
- hosts: all
sudo: yes
user: ubuntu
gather_facts: no
connection: ssh
tasks:
- action: shell sudo aptitude update
- apt: name={{ item }} state=installed
with_items:
@egonSchiele
egonSchiele / diners.hs
Last active April 23, 2022 17:29
Dining philosophers solution in Haskell using STM. Taken from http://rosettacode.org/wiki/Dining_philosophers#Haskell with some minor modifications.
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import System.Random
import Text.Printf
-- Forks
type Fork = TMVar Int
newFork :: Int -> IO Fork