Skip to content

Instantly share code, notes, and snippets.

View m13m's full-sized avatar
🏠
Working from home since 2021

Maqbool Khan m13m

🏠
Working from home since 2021
View GitHub Profile
@m13m
m13m / translate
Last active August 29, 2015 14:14
Google Translate script
#First Install this programs
sudo apt-get install libnotify-bin xsel
#Paste this code into a file and move it to the bin folder
#!/usr/bin/env bash
notify-send -u critical "$(xsel -o)" "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xsel -o | sed "s/[\"'<>]//g")&sl=auto&tl=hi" | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
@m13m
m13m / firefoxdev.sh
Last active August 29, 2015 14:22
Installing Firefox Developer Edition on Ubuntu
sudo add-apt-repository ppa:ubuntu-mozilla-daily/firefox-aurora
sudo apt-get update
sudo apt-get install firefox
@m13m
m13m / README.md
Last active August 29, 2015 14:24 — forked from ngauthier/README.md

I like Rdio and linux. Rdio works great in a browser except for one thing: keyboard shortcuts!!!

When coding, I like to be able to play/pause my music quickly, meaning I don't want to switch windows. I figured out a way to do this:

Google Chrome --app

First, I made a file in my ~/bin called rdio that runs:

google-chrome --app=http://rdio.com
{
"added_words":
[
"defi"
],
"auto_complete": false,
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
https://koding.com/R/maqbool
http://referrals.trhou.se/maqbool
@m13m
m13m / springer-free-maths-books.md
Created December 28, 2015 18:57 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links

Keybase proof

I hereby claim:

  • I am m13m on github.
  • I am maqbool (https://keybase.io/maqbool) on keybase.
  • I have a public key whose fingerprint is 45E7 CB06 C02F 3D2D 7A5D A57A 4704 9BFB 022B D9C8

To claim this, I am signing this object:

@m13m
m13m / latency.txt
Created January 31, 2017 15:27 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@m13m
m13m / recover_source_code.md
Created March 12, 2017 08:08 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
sudo apt-get install glade
sudo apt-get install libgtk-3-dev