Skip to content

Instantly share code, notes, and snippets.

View ed-flanagan's full-sized avatar
🚲
Hopefully outside

Ed Flanagan ed-flanagan

🚲
Hopefully outside
View GitHub Profile
@ed-flanagan
ed-flanagan / tweet.c
Last active December 16, 2015 18:59
Spits out up to 140 characters
#include <stdio.h>
int main(int argc, char **argv)
{
int c, i = 0;
while ((c = getchar()) != EOF && i++ < 140)
putchar(c);
}
#!/bin/sh
# Make sure to fill in your values!!
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
@ed-flanagan
ed-flanagan / connect.sh
Created July 24, 2014 05:47
SSH Port Tunneling for CouchDB
#!/usr/bin/env bash
REMOTE_USER='user'
REMOTE_HOST='example.com'
REMOTE_PORT=5984
LOCAL_HOST='localhost'
LOCAL_PORT=9000
ssh -N -L "$LOCAL_PORT:$LOCAL_HOST:$REMOTE_PORT" "$REMOTE_USER@$REMOTE_HOST"
@ed-flanagan
ed-flanagan / your_uber_rating.js
Last active August 29, 2015 14:04
Find Your Uber Passenger Rating
if (window.Uber.pingData === false) {
location.reload();
} else {
alert("Name: " + window.Uber.pingData.client.firstName + " " +
window.Uber.pingData.client.lastName + "\n" +
"Email: " + window.Uber.pingData.client.email + "\n" +
"Passenger rating: " + window.Uber.pingData.client.rating + "/5");
//JSON.stringify(window.Uber.pingData.client);
}
@ed-flanagan
ed-flanagan / largest_perfect_square.c
Last active August 29, 2015 14:04
Print the largest perfect square within given range
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
if (argc < 2) {
printf("usage: %s <limit>\n", argv[0]);
return 1;
}
@ed-flanagan
ed-flanagan / Popcorn-Time.desktop
Last active August 28, 2024 21:30
Gnome Popcorn Time application launcher
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Popcorn Time
Name[en_US]=Popcorn Time
GenericName=BitTorrent Stream Player
GenericName[en_US]=BitTorrent Stream Player
Comment=Run the Popcorn Time application
Comment[en_US]=Run the Popcorn Time application
Type=Application
@ed-flanagan
ed-flanagan / getter.sh
Created February 22, 2015 20:55
Simple wget with flags (just for reference)
#!/usr/bin/env bash
# -w 1
wget \
--page-requisites \
-r \
--convert-links \
--no-clobber \
-l inf \
@ed-flanagan
ed-flanagan / res_fix.md
Last active January 28, 2018 16:50
Debian Jessie Mate Resolution Fix for an AMD Radeon Card

Debian Jessie Mate Resolution Fix for an AMD Radeon Card

Note: possibly outdated

How-To

  1. Open /etc/apt/sources.list with your favorite text editor
  2. Change your deb sources so it looks something like this: deb http://http.us.debian.org/debian/ jessie main contrib non-free
    1. The important part is jessie...non-free
  3. Run:
@ed-flanagan
ed-flanagan / install_R.md
Last active August 29, 2015 14:19
Install R from source

Install R from source

Why not use the Aptitude package manager?

Because I find myself having to install R all the time without sudo and on systems where I can't install packages from apt-get.

So this is my "comprehensive" install script so I can pick and choose which things I need to copy-pasta to install R.

@ed-flanagan
ed-flanagan / install_Spotify.md
Last active December 26, 2017 10:56
Install Spotify Preview on Debian 8 Jessie

Install Spotify Preview on Debian 8 Jessie

Note: Possibly outdated

Note: This is more of a personal reference. You should never install/add keys/libs/programs you yourself don't trust or know are safe.

Check https://www.spotify.com/us/download/linux/ for the official scoop.

Intial Aptitude Install

  1. Add the Spotify repository signing key to be able to verify downloaded packages