Skip to content

Instantly share code, notes, and snippets.

View quassy's full-sized avatar
#MoarCoffeePlz

quassy

#MoarCoffeePlz
View GitHub Profile
@quassy
quassy / get_binary_gap.py
Last active July 31, 2020 15:23
Various iterations inclunding benchmarks for getting the binary gap
#!/usr/bin/env python3
from time import time
def timeit(func):
"""Decorator to time execution of a function and print it out."""
def timed(*args, **kw):
start = time()
result = func(*args, **kw)
@quassy
quassy / .zshrc
Created April 15, 2020 20:39
darwin config
export LC_CTYPE=en_US.UTF-8
export FIREBIRD_HOME=/Library/Frameworks/firebird.framework/Resources
export PATH=$PATH:$FIREBIRD_HOME/bin
export LOCAL_IP=`ipconfig getifaddr en0`
# alias
alias home='cd ~ && ll'
alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -GwF'
@quassy
quassy / cloudSettings
Last active October 21, 2019 21:22
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-21T21:22:25.828Z","extensionVersion":"v3.4.3"}
@quassy
quassy / materialdesign2.css
Created July 25, 2018 02:45
Color and consistency over whitespace and waste
/* Mail */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("mail.google.com") {
.gb_Sa:not(.gb_Ta) .gb_Cd {
padding: 0 !important;
}
.gb_Me {
border-radius: 0 !important;
}
.G-atb,
ac
com.ac
edu.ac
gov.ac
net.ac
mil.ac
org.ac
ad
nom.ad
ae
@quassy
quassy / firstrun.log
Last active May 27, 2016 18:23
TwoFactorAuth
$ twofactorauth
[DEBUG] Loading css file /usr/local/share/two-factor-auth/data/style.css
[DEBUG] [APP MENU] : adding gnome shell menu
[ERROR] Coudln't check if a table exists
[ERROR] no such table: providers
# App starts and looks fine, no entries of course
# I added a new entry with an invalid secret (called Google, secret code "abcde")
[ERROR] Canno't generate a two-factor auth code
[ERROR] Incorrect padding
[ERROR] Couldn't generate the code
@quassy
quassy / prime-factors.js
Last active February 11, 2016 11:40
prime-factors.js
var getPrimeFactors = function (number) {
var i = 2;
var limit = Math.floor(number/2);
var factors = [];
while (i < limit) {
// Check if number is divisible by i, if yes add i to list of factors and repeat
// (There can be multiple prime factors of the same value, e.g. 12=2*2*3)
while (number % i === 0) {
number /= i;
factors.push(i);
@quassy
quassy / push-to-array.js
Last active February 10, 2016 23:43
Help you understand this?
text = "Kanye says: This string has the name Kenny embeded in it\n the following function should find it.";
var myName = "Kenny"; //String to find
var hits = []; // Empty array to put it into
var altHits = []; // Empty list for alternative hits
// Look for "K" in the text
/*
Loop over numbers from `0` to `text.length`
so you can access the single characters of `text`
[
{
"name": "Google Chrome",
"icon": "google-chrome",
"issue": 30,
},
{
"name": "Texmaker",
"icon": "",
"issue": 31,
@quassy
quassy / Solus Snippets.md
Last active June 16, 2016 19:59
Solus Snippets

Quick scripts for Solus, mostly for building and installing elementary apps from git.