Skip to content

Instantly share code, notes, and snippets.

View alecthegeek's full-sized avatar
🤖
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
@selenamarie
selenamarie / a_better_opml.py
Last active December 11, 2015 09:59
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 dev.twitter.com/apps 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
@wolfeidau
wolfeidau / main.yml
Created December 16, 2013 23:51
NodeJS ansible task roles/nodejs/tasks/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
@lizrice
lizrice / fabfile.py
Created August 7, 2014 10:00
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 http://osxfuse.github.io/
@nf
nf / vm-setup.sh
Last active June 14, 2023 22:08
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
@ajfisher
ajfisher / _readme.md
Last active November 21, 2023 16:28
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.

const apiUrl = "http://api.quotable.io/random?tags=";
async function start() {
var quote;
var cite;
const response = await fetch(apiUrl);
const data = await response.json();
if (response.ok) {
// Update DOM elements
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

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:

    Code
    More Code
    
@BretFisher
BretFisher / Dockerfile
Last active January 4, 2024 10:11
Multi-stage Dockerfile example of installing dependencies with COPY --from
# 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
gvenzl / One Liner to download the latest release from your GitHub repo.md
Last active January 14, 2024 22:18
One Liner to download the latest release from your GitHub repo
LOCATION=$(curl -s https://api.github.com/repos/<YOUR ORGANIZTION>/<YOUR REPO>/releases/latest \
| grep "zipball_url" \
| awk '{ print $2 }' \
| sed 's/,$//'       \
| sed 's/"//g' )     \
; curl -L -o <OUTPUT FILE NAME> $LOCATION

for example:

@elimisteve
elimisteve / goroutines2.go
Last active February 18, 2024 01:52
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…
// Steve Phillips / elimisteve
// 2013.01.03
// 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 string (see sample code), and pass the result back to `main` to be printed.
//
// Do this as succinctly and readably as possible. _Go!_ #golang #programming #concurrency #challenge
package main