Skip to content

Instantly share code, notes, and snippets.

@BI1BFR
BI1BFR / baseName.cc
Last active August 28, 2022 15:23
c++11: calculate base name of __FILE__ at compile time
#include <iostream>
template<std::size_t Len>
constexpr const char* baseNameImpl(const char(&str)[Len], std::size_t pos)
{
return pos==0 ? str : (str[pos] == '/' || str[pos] == '\\') ? str+pos+1 : baseNameImpl(str, --pos);
}
template<std::size_t Len>
constexpr const char* baseName(const char(&str)[Len])
@BI1BFR
BI1BFR / ascii.sh
Created September 7, 2014 00:06
have fun!
#!/bin/bash
fonts=(1row 3-d 3d_diagonal 3x5 4max 5lineoblique B1FF DANC4 Georgia11 ICL-1900 acrobatic alligator alligator2 alligator3 alpha alphabet amc3line amc3liv1 amcaaa01 amcneko amcrazo2 amcrazor amcslash amcslder amcthin amctubes amcun1 arrows ascii_new_roman avatar banner banner3-D banner3 banner4 barbwire basic bear bell benjamin big bigchief bigfig binary block blocks bolger braced bright broadway broadway_kb bubble bulbhead calgphy2 caligraphy cards catwalk chiseled chunky coinstak cola colossal computer contessa contrast cosmic cosmike crawford crazy cricket cursive cyberlarge cybermedium cybersmall cygnet dancingfont decimal defleppard diamond dietcola digital doh doom dosrebel dotmatrix double doubleshorts drpepper dwhistled eftichess eftifont eftipiti eftirobot eftitalic eftiwall eftiwater epic fender filter fire_font-k fire_font-s flipped flowerpower fourtops fraktur funface funfaces fuzzy georgi16 ghost ghoulish glenyn goofy gothic graceful gradient graffiti greek heart_left heart_right henr