Skip to content

Instantly share code, notes, and snippets.

Arthur Simon arvinsim

Block or report user

Report or block arvinsim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
arvinsim / dark_hacker_new_solarized_custom.css
Created Oct 12, 2017
Dark Hacker News - Solarized Custom
View dark_hacker_new_solarized_custom.css
* {
color: #93A1A1 !important;
background-color: #002b36 !important;
body > center > table > tbody > tr:first-child * {
background-color: #073642 !important;
body > center > table > tbody > tr:first-child * a:hover {
background: #002b36 !important;
arvinsim / keybindings.json
Last active Apr 13, 2017
Visual Studio Code Keybindings
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
"key": "cmd+k cmd+p",
"command": "python.execInTerminal",
"when": "editorTextFocus"
arvinsim / flatten.js
Created Mar 6, 2017
Code to flatten an array of arbitrarily nested arrays of integers into a flat array of integers.
View flatten.js
// NodeJS
const assert = require('assert');
* Flatten an array of arbitrarily nested arrays of integers into a flat array of integers.
* e.g. [[1,2,[3]],4] -> [1,2,3,4].
* @name flatten
* @param {Array} arr An array to flatten, nested or otherwise
* @returns {Array} the flattened array
View Awesome Quotes
It's best to be honest with yourself and come to terms with where you are in life and where you want to be. After that, unless you put action into your belief, you will be sad. Even if you fail, but put action into the belief, you'll be happy and have grown.
There is nothing noble in being superior to your fellow man; true nobility is being superior to your former self.
If your life sucks, make it better. No one will do it for you. Period.
“It’s only on the brink that people find the will to change. Only at the precipice do we evolve.”
arvinsim /
Created Mar 17, 2015
Check if a file is valid PNG
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
from PIL import Image
# Get filename from arguments
parser = argparse.ArgumentParser(description='get arguments')
arvinsim / keyboard shortcuts
Last active Aug 29, 2015
Keyboard shortcuts for my machines
View keyboard shortcuts
// Terminator
Control + Shift + e = split Horizontally
Control + Shift + o = split Vertically
Control + Shift + t = open new tab
Control + Shift + i = open new window
Control + Shift + w = close terminal
Control + Shift + q = close window
Control + Shift + g = reset and clear the terminal
Alt + any directional button = focus on terminal depending on direction
arvinsim / factorial.hs
Last active Aug 29, 2015
A simple factorial function in Haskell
View factorial.hs
factorial :: Integer -> Integer
factorial i
| i <= 0 = 1
| otherwise = i * factorial(i-1)
main = do
-- 120
print (factorial 5)
arvinsim / get_git_remote_origins
Created Mar 3, 2015
A hacky script to get the remote origins of the git repositories of in the current directory
View get_git_remote_origins
import os
import subprocess
import re
currentdir = os.getcwd()
filename = currentdir + "/"
pattern = re.compile("(?P<push_url>Push\s+URL):\s+(?P<url>https.*)")
# Check if file exists. If it does, delete it.
if os.path.isfile(filename):
You can’t perform that action at this time.