Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Cipriani thcipriani

View GitHub Profile
@montehurd
montehurd / matplotlib.sh
Last active May 14, 2021
Super easy method for experimenting with matplotlib graphs - with a bunch of examples. Approach used below is for purpose of quick prototyping (configure graphs, convert output to base64 encoded html tags, send html directly to browser). Script is easily modified and can run by pasting its text into a Terminal window. Tested on macOS.
View matplotlib.sh
#!/bin/bash
read -r -d '' PYTHON_SCRIPT << --END
import base64
import cStringIO
from matplotlib import animation
from tempfile import NamedTemporaryFile
import matplotlib.pyplot as plt
import numpy as np
@gertvdijk
gertvdijk / init_and_start_gerrit.sh
Created Jul 27, 2018
Init and start Gerrit in a single shell script example
View init_and_start_gerrit.sh
#!/bin/sh -ex
SITE_PATH="${HOME}/site"
GERRIT_WAR="/path/to/gerrit.war"
# Because Gerrit's "daemon --init" can't take init options we will do this
# separately. Feature request filed:
# https://bugs.chromium.org/p/gerrit/issues/detail?id=9004
# Init site (provision). Note that the GERRIT_WAR may be a different version
@prasanthj
prasanthj / lirc-pi3.txt
Last active Apr 21, 2022
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
View lirc-pi3.txt
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@seanmhanson
seanmhanson / ableismSanityCheck.md
Created Apr 3, 2017
Ableist Language in Code: Sanity Check
View ableismSanityCheck.md

Ableist Language in Code: Sanity Check

Removing ableist language in code is important; it helps to create and maintain an environment that welcomes all developers of all backgrounds, while emphasizing that we as developers select the most articulate, precise, descriptive language we can rather than relying on metaphors. Quite simply, avoiding ableist language lets us make sure we are inclusive of all developers, while moving toward language that is simultaneously more acccessible to developers whose first language might not be our own.

The phrase sanity check is ableist, and unnecessarily references mental health in our code bases. It denotes that people with mental illnesses are inferior, wrong, or incorrect, and the phrase sanity continues to be used by employers and other individuals to discriminate against these people.

There are a ton of alternatives, and one of the best ways to select one is to ask yourself: What am I actually checking? and select something more descriptive. In everyday c

@oifland
oifland / Jenkinsfile
Last active Jun 21, 2022
Loops in Jenkinsfiles
View Jenkinsfile
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@altercation
altercation / xmonad.hs
Created Jan 10, 2017
XMonad Config for video bug report re: screenlock obscured by windows after switching displays
View xmonad.hs
{-# LANGUAGE AllowAmbiguousTypes, DeriveDataTypeable, TypeSynonymInstances, MultiParamTypeClasses #-}
-- a little messy, I know, but it's WIP
---------------------------------------------------------------------------
-- Ethan Schoonover <es@ethanschoonover.com> @ethanschoonover --
-- https://github.com/altercation --
---------------------------------------------------------------------------
-- current as of XMonad 0.12
@joakin
joakin / README.md
Last active Jan 14, 2019
Collapse repeated unread notifications in phabricator
View README.md
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active Jun 24, 2022
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward
View README-setup-tunnel-as-systemd-service.md

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@robacarp
robacarp / deep_thought.rb
Last active Feb 15, 2018
Testing ruby mutexs across threads and forks
View deep_thought.rb
# Deep Thought is a computer that was created by the pan-dimensional,
# hyper-intelligent species of beings (whose three-dimensional
# protrusions into our universe are ordinary white mice) to come up
# with the Answer to The Ultimate Question of Life, the Universe,
# and Everything. Deep Thought is the size of a small city.
class Worker
MUTEX = Mutex.new
@@mutex = Mutex.new
@PurpleBooth
PurpleBooth / README-Template.md
Last active Jun 26, 2022
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites