I hereby claim:
- I am eugenius1 on github.
- I am esebi (https://keybase.io/esebi) on keybase.
- I have a public key ASCrrJ0dqlZy83VDWPANK2-WQ_S1BBGND_BqfLmuZwWeYQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Inspired by https://stackoverflow.com/a/11257124/5288481 | |
// Assumes all objects have the same keys | |
function objArrayToCsv(objArray, header=true) { | |
// parse to object if not already one | |
let array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; | |
let str = ''; | |
// header row | |
if (header && array.length >= 1) { | |
let line = ''; |
\usepackage[super]{nth} | |
% code with syntax highlighting | |
\usepackage{minted} | |
\usemintedstyle{} | |
\setminted[C]{ | |
tabsize=4, | |
linenos=true, | |
frame=lines, | |
fontsize=\footnotesize |
Demo here.
Shows a row of native social sharing buttons with counts, for Twitter, Facebook, Google+ and LinkedIn. Sharing is still possible without JavaScript and also in text-only modes, via url APIs. Uses Bootstrap for column placement.
On mobile phone screens (xs
), the row becomes two rows with one button on each.
On UNIX, see the text-only experience with terminal command lynx http://eusebius.tech/#social-share-buttons
Replace EusebiusTech
in Twitter with your own hashtags. %23
is the url encoding of #
. See docs for more info.
def all_subsets(arr): | |
"""Returns a list of all subsets of a given list. | |
Mathematically: a set of all subsets of a set | |
Notes: | |
- Duplicates are treated distinct, i.e no duplicate checking or filtering. | |
- Recursive implementation. | |
""" | |
set_length = len(arr) |
#include <numeric> // std::accumulate | |
#include "tbb/parallel_reduce.h" | |
#include "tbb/blocked_range.h" | |
template <class Summable, class SummableIt> | |
Summable parallelAccumulate( | |
SummableIt beginIt, | |
SummableIt endIt, | |
const Summable initial | |
) const { |
#!/bin/bash | |
# 1. Store this in your HPCE folder, i.e ~/Documents/EEE/4/HPCE | |
# 2. Fill in your Imperial login below, no spaces | |
# 3. Invoke with `bash ./new-cw.sh 1` (without quotes and where 1 is the new coursework number) | |
ic_login=xyz89 | |
if [ ! "$1" ] | |
then | |
echo "You forgot the coursework number. Goodbye" | |
exit |
# http://www.imagemagick.org/script/command-line-processing.php#geometry | |
# http://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick | |
# run from raw/ | |
cd raw/ | |
for pic in img/covers/*.jpg; | |
do convert -strip -quality 80% -interlace Plane -gaussian-blur 0.05 -resize "1920>" "$pic" "../$pic"; | |
done |
#! /bin/sh | |
git status; | |
echo '\ntype your commit message to proceed with pushing new changes, or \033[31m"n" to abort\033[39m' | |
# \033 or \x1B or \e | |
read CommitMessage; | |
if [ "$CommitMessage" != "n" ] && [ "$CommitMessage" != "" ] && [ "$CommitMessage" != "N" ] | |
then | |
git add . && git commit -m "'$CommitMessage'" && git push |
#https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Easter_eggs | |
from __future__ import braces | |
import this | |
import __hello__ | |
import antigravity |