Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@theaboutbox
theaboutbox / .ackrc
Created September 20, 2012 21:49
My .ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@briandoll
briandoll / A_toast_to_you.md
Last active March 19, 2022 01:17
Toasts! - scripts to convert images attached to GitHub issues into an animated gif for serious celebratory purposes

To toast:

  • Make sure you have ImageMagick installed (brew install imagemagick)
  • Change line 7 of toast.rb to the repository name you're working with
  • toast!
$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@thirteen37
thirteen37 / pixel-arch.md
Last active June 6, 2020 07:47
Installing Arch on the Chromebook Pixel

This describes my basic Arch Linux installation on my Chromebook Pixel.

Note: I'm a coward, so I installed Arch to an SD card instead of wiping out the existing SSD.

Requirements

  • SD card. A very minimal Arch installation with XFCE will need about 2GB, so I think 4GB is the minimum you can get by with.
  • Arch installer on a USB drive. The 2013.05.01 is broken with the recent netctl change. So either get an older or newer one.
  • Some Arch Linux familiarity.
  • Time, patience, and good eyesight.
@jordanorelli
jordanorelli / fuck_time_warner.md
Last active June 3, 2019 14:14
Fuck you, Time Warner Cable

I missed a payment on my Time Warner Cable bill. Prior to this, the hostname of my laptop was "yupa" (after Master Yupa, from Nausicaa of the Valley of the Wind, because it's a MBA, get it, air? ok, sorry, that's fucking awful I know). Anyway, look at what my hostname is now:

jordanorelli@auto-prov[0] ~: hostname
auto-prov.rr.com

umm, excuse me, I never changed my hostname. Anyway, let's back the fuck up and see how I even discovered this.

When I got home today, I opened my MBA and fired up Chrome. On startup, it tried to open up all the tabs that were open when I closed it. Some of these included a google.com page. All of them were, instead, redirected to whatever hostname they were talking to, with ap_index tacked on the end. E.g., refreshing a Google page bounced me to google.com/ap_index, which is the automatic provisioning page that a Time Warner Cable tech is supposed to see when they start up the computer. My brother (who is also my roommate) opened the account and has all the i