Skip to content

Instantly share code, notes, and snippets.

Vlad-Ștefan Harbuz vladh

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am vladh on github.
  • I am vladh (https://keybase.io/vladh) on keybase.
  • I have a public key whose fingerprint is 7B0E 41F7 6F5B FB9B FEC2 7C18 1129 11A0 041D 4A4E

To claim this, I am signing this object:

@vladh
vladh / periodic_longest_word.py
Last active Oct 10, 2016
Longest word that can be formed using element symbols from the periodic table
View periodic_longest_word.py
WORDS_PATH = '/usr/share/dict/words'
SYMBOLS = ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Uun', 'Uuu', 'Uub', 'Uut', 'Uuq', 'Uup', 'Uuh', 'Uus', 'Uuo']
def get_words():
with open(WORDS_PATH) as f:
return f.read().split("\n")
# https://stackoverflow.com/questions/5996621/algorithm-for-checking-if-a-string-was-built-from-a-list-of-substrings
def composable(string, words, composable_parts={}):
if len(string) == 0:
View gist:05935dbe9659d2dd62a8
require = function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
var i = "function" == typeof require && require;
if (!h && i) return i(g, !0);
if (f) return f(g, !0);
var j = new Error("Cannot find module '" + g + "'");
throw j.code = "MODULE_NOT_FOUND", j
}
View gist:eb9062a7d6a70f1b1603
### Keybase proof
I hereby claim:
* I am vladh on github.
* I am vladh (https://keybase.io/vladh) on keybase.
* I have a public key whose fingerprint is 5031 B675 5AFB 3A5F A915 D2D3 38DB 00FE 96D3 CEE1
To claim this, I am signing this object:
@vladh
vladh / opengl-macos.md
Last active May 30, 2020
Compile OpenGL apps on Mac OS X
View opengl-macos.md

Make the following changes

GLUT

Before:

#include <GL/glut.h>

After:

#ifdef __APPLE__
@vladh
vladh / clojure-ctags.md
Last active Jan 17, 2020
Add Clojure support to exuberant ctags and vim-tagbar
View clojure-ctags.md

ctags

Add the following to ~/.ctags (thanks, xzj / clojure.ctags):

--langdef=Clojure
--langmap=Clojure:.clj
--regex-clojure=/\([ \t]*create-ns[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/n,namespace/
--regex-clojure=/\([ \t]*def[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/d,definition/
--regex-clojure=/\([ \t]*defn[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/f,function/
--regex-clojure=/\([ \t]*defn-[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/p,private function/
You can’t perform that action at this time.