Skip to content

Instantly share code, notes, and snippets.

View jeffjewiss's full-sized avatar

Jeff Jewiss jeffjewiss

View GitHub Profile
@masnick
masnick / gist:1654182
Created January 21, 2012 21:52
Amazon S3 bucket policy for www.maxmasnick.com
{
"Version": "2008-10-17",
"Id": "b2cc31d0-cc91-4285-a658-473099d2c867",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@dhg
dhg / davegamache_bash_alias
Created July 15, 2012 23:48
Davegamache deploy bash alias
alias buildit='
cp -r _site/ ../temp
&& git checkout gh-pages
&& cp -r ../temp/* ./
&& rm -r ../temp
&& git add -A
&& git status'
@mrrooijen
mrrooijen / README.md
Created August 15, 2012 01:30
Heroku SSL Endpoint, RapidSSL

Heroku SSL Endpoint

Assumptions:

  • You want to enable SSL for your domain.
  • You want to go with RapidSSL.
  • Your domain name is www.domain.com during this example.
  • You want to encrypt requests for a single domain (no wildcard)
  • You want to apply this certificate to Heroku's SSL Endpoint
defmodule EvercamMedia.SnapmailController do
...
def update(conn, %{"id" => snapmail_exid} = params) do
current_user = conn.assigns[:current_user]
with :ok <- authorized(conn, current_user),
{:ok, cameras} <- ensure_cameras_exist("update", conn, params["camera_exids"], current_user),
{:ok, snapmail} <- snapmail_exist(conn, snapmail_exid),
true <- snapmail.user_id == current_user.id
do
@zachleat
zachleat / reading_time.rb
Last active October 21, 2020 23:00
Read this in X minutes Liquid Filter Plugin (for Jekyll)
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@atomkirk
atomkirk / endpoint.ex
Created February 23, 2018 16:50
raw body plug parser
plug Plug.Parsers,
parsers: [ZB.Parsers.RAWBODY, :urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
@twe4ked
twe4ked / input.scss
Created December 5, 2011 06:27
FREE! Sass (SCSS) mixin for including retina images (useful when developing for iOS).
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}
@NahimNasser
NahimNasser / weekly_git_log_generator.py
Created February 12, 2013 18:39
Git log summary, week by week for your entire project.
"""
Outputs a week by week commit log with one line commit messages for your entire git repository
from start to finish
"""
import commands
import datetime
status, start_date = commands.getstatusoutput("git log --date=short --format='%cd' --reverse | head -1")
status, end_date = commands.getstatusoutput("git log --date=short --format='%cd' -1")
@rauchg
rauchg / effective-es6.md
Last active July 11, 2023 09:38
Writing ES6 today, effectively.

Effective transpiling of ES6

After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.

I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.

The main tool

When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:

@booleanbetrayal
booleanbetrayal / Gruntfile.js
Last active November 9, 2023 18:59
Example GruntJS configuration for a replacement to the Sprockets Rails asset pipeline
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {