Skip to content

Instantly share code, notes, and snippets.

View alichtman's full-sized avatar
🏡
$HOME

Aaron Lichtman alichtman

🏡
$HOME
View GitHub Profile
@viliampucik
viliampucik / pythonstartup.py
Created January 11, 2021 22:02
XDG compliant ~/.python_history
# Store interactive Python shell history in ~/.cache/python_history
# instead of ~/.python_history.
#
# Create the following .config/pythonstartup.py file
# and export its path using PYTHONSTARTUP environment variable:
#
# export PYTHONSTARTUP="${XDG_CONFIG_HOME:-$HOME/.config}/pythonstartup.py"
import atexit
import os
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@echuber2
echuber2 / hidetimes1.sh
Last active March 24, 2019 19:41
Lifting bash commands for safety
# https://gist.github.com/echuber2/2b44d229bc7282a8839d506af2bddbfa
# Try source-ing this file first to disable the bash "times" command
# hidetimes1.sh
alias times=''
unalias times
lifted_times () {
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

#!/usr/bin/env bash
set -e
main() {
previous_file="$1"
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
@vmarkovtsev
vmarkovtsev / identifier_split.py
Created May 26, 2017 10:39
Identifier splitting algorithm from the paper "Topic modeling of public repositories at scale using names in source code"
import re
NAME_BREAKUP_RE = re.compile(r"[^a-zA-Z]+")
def extract_names(token):
token = token.strip()
prev_p = [""]
def ret(name):
r = name.lower()
if len(name) >= 3:
@iosecure
iosecure / iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment.md
Last active April 4, 2024 23:50
iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

This post by a security researcher who prefers to remain anonymous will elucidate concerns about certain problematic decisions Apple has made and caution about future decisions made in the name of “security” while potentially hiding questionable motives. The content of this article represents only the opinion of the researcher. The researcher apologises if any content is seen to be inaccurate, and is open to comments or questions through PGP-encrypted mail.



TL;DR

@hawkins
hawkins / screen.js
Created January 16, 2017 06:22
Node.js blessed screen - keep your output separate from your input!
/*
* I've used blessed to create a textbox at the bottom line in the screen.
* The rest of the screen is the 'body' where your code output will be added.
* This way, when you type input, your program won't muddle it with output.
*
* To try this code:
* - $ npm install blessed --save
* - $ node screen.js
*
* Key points here are:
@soxofaan
soxofaan / README.md
Last active January 19, 2024 17:48
Simple pretty CSV and TSV file viewer.
@ianklatzco
ianklatzco / catfact.py
Last active September 5, 2019 12:30
send cat facts to your friends logged into a ews/server. netid = username if you're not from uiuc
# if netid is logged in, send a random cat fact to all of its terminals.
# usage: crontab -e. paste in:
# 0 * * * * python ~/catfact.py
# logs in ~/victims.txt
# why did i spend so much time on this.
# this got me banned from the school servers for two days
messagechance = 5 # 1 is 1%, 99 is 99%. keep in mind this will only run if they're logged in.
postscript = '\n this has been an automated cat fact. contact me to unsubscribe. or to subscribe others.\n'
listofnetids = ['netids','go','here']