Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
##
## Usage:
## http-response-headers.sh 'http://www.example.com/test/' '127.0.0.1'
##
#!/usr/bin/env bash
URL="$1"
#!/usr/bin/env bash
# Installation
#
# $ bash <(curl -s https://gist.githubusercontent.com/puckbag/2e8b3c68bd21ed895ee793d8bc97f04d/raw/install-nodenv.sh)
#
# Reference
#
# https://github.com/nodenv/nodenv
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet prefetch" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<style>
#col-1 {
background-color: rgba(255, 0, 0, 0.5);
}
#col-2 {
@puckbag
puckbag / guzzle-custom-curlfactory.php
Last active November 1, 2019 23:06
Custom Guzzle CurlFactory
<?php
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlFactory;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\Handler\CurlMultiHandler;
use GuzzleHttp\Handler\EasyHandle;
@puckbag
puckbag / transfer-db.sh
Last active August 29, 2015 14:04
Transfer AMPPS db to MAMP
#!/bin/bash
# http://dev.mysql.com/doc/refman/5.5/en/copying-databases.html
PWD=`pwd`
# http://stackoverflow.com/a/3572105
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
@puckbag
puckbag / gist:2acc0f2002b6bd96abce
Last active August 29, 2015 14:04
How while and for loops function the same
// demonstrate how to construct the same loop with while and with for.
// a limited loop in while format
var limit = 10;
var i = 1;
while (i<=limit) {
console.log(i);
i = i + 1;
}
This file has been truncated, but you can view the full file.
;;; Provided courtesy of http://browscap.org/
;;; Created on Thursday, March 27, 2014 at 12:25 PM EDT
;;; Keep up with the latest goings-on with the project:
;;; Follow us on Twitter <https://twitter.com/browscap>, or...
;;; Like us on Facebook <https://facebook.com/browscap>, or...
;;; Collaborate on GitHub <https://github.com/browscap>, or...
;;; Discuss on Google Groups <https://groups.google.com/forum/#!forum/browscap>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap Version
#!/bin/bash
# example usage:
# $ sync-branch origin/production production
# issues:
# * what if files have been modified? handle pull failure.
# http://stackoverflow.com/a/12791408/1596013
# http://stackoverflow.com/a/12142066/1596013
@puckbag
puckbag / prompt.css
Created March 3, 2014 05:50
prompt.html
/*
hex:00 / rgb:0
hex:55 / rgb:85
hex:BB / rgb:187
hex:FF / rgb:255
*/
.normal-black {
color: black; }
.normal-red {
@puckbag
puckbag / sync-downstream.sh
Last active December 19, 2015 12:59
A shell script to automate syncing a website downstream during development, including a database and media directory. Supports (MySQL,MsSQL) --> (MySQL,SQLite). Requires wget and sequel. Assumes broco environment.
#!/bin/bash
doc_root=
ftp_domain=
ftp_host=
ftp_user=
ftp_pass=
db_remote_type=tinytds
db_remote_data=
db_remote_host=