Skip to content

Instantly share code, notes, and snippets.

View ali's full-sized avatar

Ali Ukani ali

View GitHub Profile
@ali
ali / download.bash
Created July 29, 2012 08:10
Downloads all of the HOPE 9 Conference mp3s
#!/bin/bash
# Downloads all of the HOPE 9 Conference mp3s (info found on http://www.hopenumbernine.net/schedule/) to the current directory
wget -O "Michael Weinberg - 3D Printing: Making Friends in DC Before People Start Freaking Out.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9A23.mp3
wget -O "Molly Sauter - Activist DDoS Attacks: When Analogies and Metaphors Fail.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9A24.mp3
wget -O "Ray - Advanced Handcuff Hacking.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9B07.mp3
wget -O "Aditya K. Sood - Advancements in Botnet Attacks and Malware Distribution.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9C14.mp3
wget -O "James Vasile - Anti-Censorship and Anti-Surveillance Tools - Improving the Landscape.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9B31.mp3
wget -O "Jennifer Ortiz - Brain Chemistry: How Psychoactive Chemicals Hack the Central Nervous System.mp3" http://c3455205.r5.cf0.rackcdn.com/HN9B26.mp3
@ali
ali / eventEmitterMiddleware.js
Created March 1, 2016 18:40
EventEmitterMiddleware allows your Redux actions to emit events to an external event emitter
/**
* A Redux middleware that externally emits events from actions.
* @param {EventEmitter} emitter - emits events
* @returns {Function} a Redux middleware
*/
export const eventEmitterMiddleware = (emitter) => {
if (!emitter) {
throw new Error('Cannot emit events. No EventEmitter provided.')
}
@ali
ali / README.md
Last active June 15, 2020 12:06
large files in iheanyi/bandcamp-dl

I followed the instructions from the first Google result for "big git objects pack size": http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history

Summary of how to create bigtosmall.txt:

git rev-list --objects --all | sort -k 2 > allfileshas.txt```
git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r > bigobjects.txt```
for SHA in `cut -f 1 -d\  < bigobjects.txt`; do
echo $(grep $SHA bigobjects.txt) $(grep $SHA allfileshas.txt) | awk '{print $1,$3,$7}' >> bigtosmall.txt
done;
@ali
ali / 0001-Update-to-Hyper-v0.8.1.patch
Last active June 15, 2020 12:06
diff for Hyper's PKGBUILD in the AUR
From a0495499594e0f49d75ae96a93fbb52efef0becc Mon Sep 17 00:00:00 2001
From: Ali Ukani <ali.ukani@gmail.com>
Date: Fri, 7 Oct 2016 18:36:30 -0400
Subject: [PATCH] Update to Hyper v0.8.1
---
PKGBUILD | 31 ++++++++++++-------------------
autohide-menu.patch | 12 ------------
2 files changed, 12 insertions(+), 31 deletions(-)
delete mode 100644 autohide-menu.patch
@ali
ali / Hyper.desktop
Last active June 15, 2020 12:06
/usr/share/applications/Hyper.desktop
[Desktop Entry]
Name=Hyper
Comment=JS/HTML/CSS Terminal
Exec=Hyper
Icon=/usr/share/pixmaps/hyper.png
Terminal=false
Type=Application
Categories=Development;
@ali
ali / configureApolloClient.js
Last active June 15, 2020 12:06
network interface for Apollo Client that throws away errors
import ApolloClient, { createNetworkInterface } from 'apollo-client'
const GRAPHQL_ENDPOINT_URL = "…"
const baseNetworkInterface = createNetworkInterface({ uri: GRAPHQL_ENDPOINT_URL })
// Create our own network interface that delegates to Apollo's and ignores errors
const networkInterface = {
query: (...args) => {
return baseNetworkInterface
@ali
ali / arch-linux-install
Created April 21, 2018 21:19 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@ali
ali / color-conversion-algorithms.js
Created August 16, 2018 13:39 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@ali
ali / gist:aeee4516907327e3f96c
Created April 18, 2015 01:45
ssh-copy-id fails if the remote user's default shell is fish
~ $ ssh-copy-id -i ~/.ssh/id_rsa -o PubkeyAuthentication=no ali:@orchid.local
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Password:
fish: Expected a command name, got token of type 'Run job in background'. Did you mean 'COMMAND; and COMMAND'? See the help section for the 'and' builtin command by typing 'help and'.
Standard input: mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ;
@ali
ali / ntf
Created January 18, 2012 00:33
Growl Notify for Bash: Runs command & shows Growl notification on completion
#!/bin/bash
# ntf
# Runs the command passed as the argument and shows a Growl notification when it's done.
# Usage: ntf <command>
# Example: `ntf echo hi`
# Requires Growl Notify: http://growl.info/extras.php#growlnotify
# Author: Ali Ukani
GROWLNOTIFY=/usr/local/bin/growlnotify # Location of growlnotify