Skip to content

Instantly share code, notes, and snippets.

View AdrianTP's full-sized avatar

Adrian Thomas-Prestemon AdrianTP

View GitHub Profile
@AdrianTP
AdrianTP / web-servers.md
Created October 16, 2018 16:47 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@AdrianTP
AdrianTP / postgres-cheatsheet.md
Created December 12, 2016 22:42 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@AdrianTP
AdrianTP / multiple_ssh_setting.md
Created June 15, 2016 19:26 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
ResetParams(Manual= false) {
global
Small := 1
Big := 10
LastHeading := 0
Heading := 0
MaxHeading := 359
LastRange := 0
Range := 0
@AdrianTP
AdrianTP / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
@AdrianTP
AdrianTP / flocate
Last active August 29, 2015 14:02
replacement for "locate" command which is capable of easily matching *exact* filenames -- placed here for my reference; I am not claiming credit for this; I did not make it
# Thanks to Dark_Helmet
# http://www.linuxquestions.org/questions/linux-newbie-8/can-i-specify-an-exact-filename-in-%27locate%27-205840/#post1053288
function flocate
{
if [ $# -gt 1 ] ; then
display_divider=1
else
display_divider=0
fi
@AdrianTP
AdrianTP / basicEventGenerator
Created May 29, 2014 21:01
Basic Event Generator
var event = function(id, year, month) {
var zeroMonth = (function(month) {
var mo = "" + month;
return (mo.length < 2) ? "0" + mo : mo;
})(month),
randomDate = (function(from, to) {
var num = "" + Math.floor(Math.random() * (to - from + 1) + from);
return (num.length < 2) ? "0" + num : num;
})(1, 28),
dateString = "" + year + "-" + zeroMonth + "-" + randomDate + "T00:00:00Z";
@AdrianTP
AdrianTP / GitHub Issue2PullRequest v1
Created April 3, 2014 21:15
Easily attach a newly-pushed fork branch to an existing issue on the original repo as a pull request -- currently does nothing with the output from the GitHub API.
#!/bin/bash
function beginIssuePull {
# Get info for pull request
echo "Please specify the following:\n"
read -e -p "GitHub username: " USERNAME
read -e -p "Issue number: " ISSUE
read -e -p "Fork branch name: " FORKBRANCH
read -e -p "Destination branch name (e.g. master): " DESTBRANCH
read -e -p "Destination repository (<original_user>/<repo_name>): " DESTREPO