Skip to content

Instantly share code, notes, and snippets.

Dem keyboards don't go click click on their own you know

Alec Clews alecthegeek

Dem keyboards don't go click click on their own you know
View GitHub Profile
BretFisher / Dockerfile
Last active Dec 9, 2021
Multi-stage Dockerfile example of installing dependencies with COPY --from
View Dockerfile
# any images you use later, add them here first to create aliases
# I like keeping all my versions at the top
FROM node:14.3-slim as node
FROM php:7.2.1-fpm-slim as php
FROM nginx:1.17 as nginx
# The real base image to start from
FROM ubuntu:focal-20210827 as base
# install apt stuff
gvenzl / One Liner to download the latest release from your GitHub
Last active Jun 11, 2021
One Liner to download the latest release from your GitHub repo
View One Liner to download the latest release from your GitHub
LOCATION=$(curl -s<YOUR ORGANIZTION>/<YOUR REPO>/releases/latest \
| grep "tag_name" \
| awk '{print "<YOUR ORGANIZATION>/<YOUR REPO>/archive/" substr($2, 2, length($2)-3) ".zip"}') \

for example:

LOCATION=$(curl -s \
| grep "tag_name" \
steinwaywhw / One Liner to Download the Latest Release from Github
Last active Jan 15, 2022
One Liner to Download the Latest Release from Github Repo
View One Liner to Download the Latest Release from Github
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
nf /
Last active Aug 12, 2021
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
export CDPATH=.:$HOME/src/$HOME/go/src:$HOME/src/$HOME/src/$HOME/src/
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
ajfisher /
Last active Mar 2, 2021
Auto WiFi detection and hotspot creation in boot for RPI

Auto WiFi detection or wifi hostpot creation during boot for RPI

Note: These are rough notes and there may be some variance as versions of raspbian get updated but should be pretty reliable as a guide.

This gist provides some instructions and config in order to have your Raspberry PI automatically connect to a roamed network, however if it fails to discover an available network it will set itself up as a wireless access point for you to connect to.

lizrice /
Created Aug 7, 2014
Fab file for connecting and disconnecting to Raspberry PI
from __future__ import with_statement
from fabric.api import local, lcd
# Usage:
# fab connect - mounts /home/pi/<pi_dir> so it's available locally at <workspace><remote>
# fab disconnect - unmount
# Note this is Mac specific - Linux distributions use fusermount -u instead of umount
# Requires OSXFUSE and SSHFS from
wolfeidau / main.yml
Created Dec 16, 2013
NodeJS ansible task roles/nodejs/tasks/main.yml
View main.yml
- name: Install PPA for latest nodejs version
apt_repository: repo=ppa:chris-lea/node.js state=present
tags: install_nodejs_ppa
- name: Install Nodejs package
apt: pkg=nodejs state=latest update_cache=yes
tags: install_nodejs
- name: Install global tools
command: npm install {{ item }} -g
selenamarie /
Last active Dec 11, 2015
This grabs URLs associated with the people you follow on Twitter and then tries to scrape RSS feeds from the URLs. You have to get OAUTH creds from to do this, and then register the script so that you get the access_token + access_token_secret. Rev 2 actually produces valid OPML. ;)
#!/usr/bin/env python
import tweepy
from BeautifulSoup import BeautifulSoup as parser
import urllib
import sys
import argparse
import ConfigParser
elimisteve / goroutines2.go
Created Jan 3, 2013
Programming Challenge: Launch 4 threads, goroutines, coroutines, or whatever your language uses for concurrency, in addition to the main thread. In the first 3, add numbers together (see sample code below) and pass the results to the 4th thread. That 4th thread should receive the 3 results, add the numbers together, format the results as a strin…
View goroutines2.go
// Steve Phillips / elimisteve
// 2013.01.03
package main
import "fmt"
// intDoubler doubles the given int, then sends it through the given channel
func intDoubler(ch chan int, n int) {
ch <- n*2
clintel / gist:1155906
Created Aug 19, 2011
Fenced code in bullet lists with GitHub-flavoured MarkDown??
View gist:1155906

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    More Code