This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eu-readelf --debug-dump=info /usr/lib/debug/usr/bin/emacs-25.2-nox.debug | grep producer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -iname \*.cc -o -iname \*.hh | while read -r i ;do wc -L $i;done | awk '{ if ($1 > 110) printf "%50s %3d\n", $2, $1 }' | sort -n -k 2 -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/date_time/posix_time/posix_time.hpp> | |
#include <boost/date_time/local_time_adjustor.hpp> | |
#include <iostream> | |
int main() | |
{ | |
boost::posix_time::ptime x = boost::posix_time::time_from_string("2017-03-30 14:16:02.713506"); | |
std::cout << x << std::endl; | |
typedef boost::date_time::local_adjustor<boost::posix_time::ptime, +2, boost::posix_time::no_dst> cest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (distance<home, work>::value < km<2>::value) | |
go_by_foot<work>(); | |
else if (distance<my_car, home>::value | |
+ distance<free_parking_lot, work>::value | |
< km<1>::value) | |
go_by_car<work>(); | |
else | |
go_by_public_transport<work>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iterator> | |
int main(int argc, char *argv[]) | |
{ | |
std::fstream is, os; | |
if (argc < 3) | |
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef HAVE_STD | |
#include <iostream> | |
using namespace std; | |
#else | |
#include <iostream.h> | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a = [1, 2, 3] | |
>>> import dis | |
>>> def f(): | |
print a[len(a)-1] | |
... ... | |
>>> def g(): | |
print a[-1] | |
... ... | |
>>> dis.dis(f) | |
2 0 LOAD_GLOBAL 0 (a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if sys.platform == "win32": | |
import os, msvcrt | |
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
if len(sys.argv) < 2: | |
sys.exit(1) | |
with open(sys.argv[1], 'rb') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import zipfile | |
archive = 'something.zip' | |
with zipfile.ZipFile(archive, 'r') as myzip: | |
for zi in myzip.infolist(): | |
if zi.filename.endswith('.json'): | |
with myzip.open(zi, 'rU') as f: | |
for line in f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax match BeforeSpace /^ */ containedin=ALL | |
syntax match AfterSpace / *$/ containedin=ALL | |
syntax match InsideSpace "\t *\t"hs=s+1,he=e-1 containedin=ALL | |
highlight BeforeSpace ctermbg=DarkBlue | |
highlight AfterSpace ctermbg=DarkBlue | |
highlight InsideSpace ctermbg=DarkBlue |