Skip to content

Instantly share code, notes, and snippets.

View nitsas's full-sized avatar
☀️

Chris Nitsas nitsas

☀️
View GitHub Profile
@nitsas
nitsas / .tigrc
Created May 24, 2021 15:27
My ~/.tigrc file. Configuration for tig: https://jonas.github.io/tig/
# Configuration for tig: https://jonas.github.io/tig/
# Usage: Either copy paste parts of this into your ~/.tigrc, or download the whole file.
# Find more useful bindings at: https://github.com/jonas/tig/wiki/Bindings
#
# You might also want to read the tig manual:
# http://jonas.nitro.dk/tig/manual.html
#
# Note that there's also a system-wide tigrc sitting at: /usr/local/etc/tigrc
#
@nitsas
nitsas / til.md
Created October 18, 2017 11:20
history from our #til slack channel
@nitsas
nitsas / set.js
Last active March 24, 2022 02:18 — forked from brettz9/set.js
Simple JS equivalent of the Python set() constructor (without the methods)
/**
* Simple JS equivalent of the Python set() constructor (without the methods)
* @requires shim: Array.prototype.indexOf
* @param {array} arr The array to turn into a set
* @example
* var mySet = set(['red', 'yellow', 'black', 'yellow']);
* mySet.length; // 3
* JSON.stringify(mySet); // ["red","yellow","black"]
* @see For a fuller version, see {@link https://npmjs.org/package/set}
*/
#!/usr/bin/env python
"""
git fuzzy-checkout
Same as `git checkout branch`, but with fuzzy matching if checkout fails.
Turns `git checkout barnch` into `git checkout branch`,
assuming `branch` is a branch.
"""
import difflib
@nitsas
nitsas / fix_osx_chrome_fonts
Created May 21, 2015 15:39
Fix broken fonts in chrome for mac
#!/usr/bin/env bash
# This should fix broken fonts in chrome for mac.
# (from here: http://surgeworks.com/blog/general/how-to-fix-chrome-for-mac-broken-fonts)
atsutil databases -removeUser
atsutil server -shutdown
atsutil server -ping
@nitsas
nitsas / chrome
Last active August 29, 2015 14:20
Bash script that opens URLs or local HTML files using Google Chrome.
#!/usr/bin/env bash
open -a "Google Chrome" $@
@nitsas
nitsas / demonstration.sh
Last active March 26, 2016 16:47
while loop, for loop, backticks και ελληνικό ερωτηματικό
# Ό,τι είναι μετά από δίεση είναι σχόλια, τα υπόλοιπα κώδικας.
# Το αρχείο τρέχει έτσι όπως είναι, το δοκίμασα.
# Ένα απλό while loop:
i="0"
while [ $i -lt 4 ]
do
echo $i
i=$[$i + 1]
done
@nitsas
nitsas / search_for_word.py
Created April 10, 2012 23:52
A simple Python program. You give it a filename and a word and it checks if the word is in the file.
# Γλώσσα: Python που είναι εύκολη και δυνατή ;)
# από εδώ την κατεβάζεις: http://www.python.org/ftp/python/3.2.2/python-3.2.2.msi
# Τρόπος χρήσης (από γραμμή εντολών):
# python search_for_word.py filename word
# Όποια γραμμή ξεκινάει με δίεση είναι σχόλια, δεν κάνει τίποτα.
# αυτό το βάζουμε πάντα