Skip to content

Instantly share code, notes, and snippets.

@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@johnallen3d
johnallen3d / delete-vpc.bash
Created April 1, 2015 19:01
Destroy AWS VPC Relies on a docker image with the aws-cli pre-installed
#!/bin/bash
# docker run --rm -t -i -v $(pwd)/.awscreds:/root/.aws alexturek/aws-cli-docker configure
alias aws="docker run --rm -t -i -v $(pwd)/.awscreds:/root/.aws alexturek/aws-cli-docker"
# vpc name
name=Sandbox
# query for vpc idvpc
@eseyden
eseyden / RemoteViewFinder.php
Last active August 29, 2015 14:16
Fetch Remote View Laravel
<?php namespace Acme\View;
use Illuminate\View\FileViewFinder;
use Cache;
use Carbon\Carbon;
use File;
class RemoteViewFinder extends FileViewFinder {
public function find($name)
{
# Varnish 4.0 file for our Craft CMS projects
# Based on https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
#
# This is still work in progress, comments appreciated.
vcl 4.0;
import std;
import directors;
@ricardo-rossi
ricardo-rossi / StripeBilling.php
Created September 18, 2014 19:34
Laravel Adapter for Stripe Billing
<?php namespace Endata\Billing;
use Stripe;
use Stripe_Charge;
use Stripe_Customer;
use Stripe_InvalidRequestError;
use Stripe_CardError;
use Config;
use Exception;
@miguelramos
miguelramos / nginx.conf
Last active January 21, 2017 04:40
Nginx Grav
server {
listen 80;
server_name *.grav.dev;
root /home/www/grav.dev;
index index.html index.htm index.php;
charset utf-8;
location /user {
rewrite ^/user/accounts/(.*)$ /error redirect;
@geelen
geelen / gulpfile.js
Last active October 11, 2017 11:47 — forked from superhighfives/gulpfile.js
Harp with BrowserSync! Woo!
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server(__dirname + '/src', {
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@johanhalse
johanhalse / gist:9049840
Created February 17, 2014 12:39
JavaScript concatenation and uglification with Harp server
// Wrapper for Harp web server, to include JS concat/compile step. Put your stuff
// in /harp subdirectory, npm install your dependencies, run, enjoy.
// Live updating of the concatenated JS file left as an exercise for the reader :)
var fs = require('fs');
var path = require('path');
var harp = require('harp');
var UglifyJS = require('uglify-js');
var files = [];
files.push(__dirname + '/harp/js/file0.js');
@robert-b-clarke
robert-b-clarke / deploy_to_s3.py
Created January 27, 2014 10:51
A simple python script for copying static web resources to an S3 bucket and advance gzipping JS and CSS. Let me know if it's useful (and not already implemented by something else), I may make it into a proper repo
"""
===========
Description
===========
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/
* Files overwrite old versions