Skip to content

Instantly share code, notes, and snippets.

View Tarrasch's full-sized avatar
💭
I may be slow to respond.

Arash Rouhani Tarrasch

💭
I may be slow to respond.
View GitHub Profile
{"version":1,"resource":"file:///Users/quydm/Workspace/codes/2.1-end-to-end-machine-learning-project.ipynb","entries":[{"id":"8Pvx.ipynb","source":"edit","timestamp":1653531385919},{"id":"kGIm.ipynb","timestamp":1653532319305},{"id":"UCm4.ipynb","timestamp":1653533440687},{"id":"zPdh.ipynb","source":"edit","timestamp":1653533753252},{"id":"oEQS.ipynb","source":"Insert Cell","timestamp":1653534685971},{"id":"eOUc.ipynb","timestamp":1653534793564},{"id":"SmsD.ipynb","source":"edit","timestamp":1653536355775},{"id":"6iy0.ipynb","source":"Insert Cell","timestamp":1653537021354},{"id":"1R4C.ipynb","source":"Insert Cell","timestamp":1653537430360}]}
@Tarrasch
Tarrasch / instructions.md
Last active January 16, 2016 13:40
Resources for vietnamese input

Goal

I want to use colemak+telex on Ubuntu 14.04. Preferably switching betweeen them with a keyboard shortcut.

Details

canhaz ibus-unikey
sudo cp /usr/share/ibus/component/unikey.xml{,-orig}
curl https://gist.githubusercontent.com/lewtds/14ca841f7331126ad66b/raw/86b525d474e803995dd85833fd8ae41496a5633d/unikey.xml | sudo tee /usr/share/ibus/component/unikey.xml
@Tarrasch
Tarrasch / GetHostName.hs
Created July 3, 2014 11:06
Minimal retrieving hostname in Haskell
module GetHostName where
import Foreign.Marshal.Array ( allocaArray0, peekArray0 )
import Foreign.C.Types ( CInt(..), CSize(..) )
import Foreign.C.String ( CString, peekCString )
import Foreign.C.Error ( throwErrnoIfMinus1_ )
getHostName :: IO String
getHostName = do
let size = 256
@JakeWharton
JakeWharton / GuavaCollectors.java
Last active May 10, 2018 09:08
Example Java 8 collectors for Guava.
/*
* Copyright (C) 2014 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Tarrasch
Tarrasch / main.cpp
Last active December 11, 2015 19:08
My usual cpp file template (a dsl on it's own) used forprogramming competitions
//Arash Rouhani
#define _GLIBCXX_DEBUG
//#define NDEBUG
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
@Tarrasch
Tarrasch / README.md
Last active September 12, 2016 18:14
Unity plus xmonad configuration (Ubuntu 12.04)

What

This is my xmonad+unity panel config. With this config, you'll have a well integrated panel from unity but still have xmonad as your window manager with your gnome apps, including the pretty gnome-terminal (for those too lazy to learn xmoobar).

This config doesn't have the unity launcher, mainly becuse it causes windows to be unfloatable, besides I'm not fond of it anymore.

How

Copy and paste these lines (or understand what it does and do it manually).

@Tarrasch
Tarrasch / about.md
Created July 7, 2012 17:35 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@cjerdonek
cjerdonek / test.py
Created June 24, 2012 19:16
For Python unit testing, using a context manager instead of setUp() and tearDown()
# For Python unit testing, an idea for how to use a context manager for
# a unittest.TestCase instead of the setUp() and tearDown() methods.
#
# This is a possible answer to--
#
# http://stackoverflow.com/questions/8416208/in-python-is-there-a-good-idiom-for-using-context-managers-in-setup-teardown
from contextlib import contextmanager
import unittest
@jboner
jboner / latency.txt
Last active April 25, 2024 01:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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
@Tarrasch
Tarrasch / keymap.xkb
Last active July 27, 2021 22:25
Swedish colemak (Svensk colemak)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compatibility {
include "complete"
};
xkb_symbols {
include "pc+us(colemak)+inet(evdev)"
key <RALT> {