This file contains hidden or 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
MathJax.Hub.Config({ | |
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} | |
}); | |
function hideTypeset() | |
{ | |
var HTML = MathJax.HTML; | |
var jax = MathJax.Hub.getAllJax(); | |
for (var i = 0, m = jax.length; i < m; i++) |
This file contains hidden or 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 queue import Queue | |
from threading import Thread | |
import json | |
import sys | |
import tornado.ioloop | |
import tornado.web | |
MAX_NUM_LINES_IN_BUFFER=1000 | |
MAX_NUM_LINES_PER_CHUNK=10 |
This file contains hidden or 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
javascript:(function(){(Array.from(document.body.getElementsByTagName('video'))).forEach(function(videoDom){if(videoDom.playbackRate==1.0){videoDom.playbackRate=3.0;}else{videoDom.playbackRate=1.0;}});})(); |
This file contains hidden or 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
#!/usr/bin/env bash | |
SERVER=$1 | |
OUTPUT=$2 | |
#Overview | |
# The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process. | |
# Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser). | |
# SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring that the |
This file contains hidden or 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
cmake_minimum_required(VERSION 2.6) | |
project( test CXX ) | |
# we need the M4 macro processor | |
find_program( M4_EXECUTABLE m4 DOC "The M4 macro processor" ) | |
if( NOT M4_EXECUTABLE ) | |
message( SEND_ERROR "Failed to find the M4 macro processor." ) | |
endif( NOT M4_EXECUTABLE ) | |
# - Pass a list of files through the M4 macro processor |
This file contains hidden or 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
# Copyright 2014 Aleksander Gajewski <[email protected]> | |
# created: Sun 16 Nov 2014 08:40:32 AM CET | |
# modified: Mon 17 Nov 2014 04:08:15 AM CET | |
RAMSIZE=128 | |
if [ "$1" == "" ]; then | |
echo "Simple sandbox with chroot. Usage:" | |
echo " ./sandbox.sh program_to_run [other_program_or_folder] .." | |
echo " eg. ./sandbox.sh bash bc" |
This file contains hidden or 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
# Copyright 2014 Aleksander Gajewski <[email protected]> | |
# created: Sun 26 Oct 2014 11:01:45 AM CET | |
# modified: Sun 26 Oct 2014 11:02:17 AM CET | |
# bash marks | |
MARKS_DIR=~/.bashmarks | |
MARKS_CWD=.cwd | |
mkdir -p $MARKS_DIR | |
function _l() { |
This file contains hidden or 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
(echo "digraph {"; (cat input.txt | sed -e '1!p' | sed -e '$d' | sed -e "/.*/{N;{s#\s*\n\s*# -> #g};p}" | sort | uniq); echo "}") | dot -Tpng -o output.png |
This file contains hidden or 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 re | |
import sys | |
def split_last_space(text): | |
text = re.sub(r'^ *', '', text) | |
text = re.sub(r' *$', '', text) | |
text_split = text.split(' ') | |
first = ' '.join(text_split[:-1]) | |
second = text_split[-1] |
This file contains hidden or 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 <gtest/gtest.h> | |
template<typename T> | |
struct Wrapper { | |
explicit Wrapper(T value) : value(value) {}; | |
operator T() {return value;} | |
T value; | |
}; | |
template<typename T> |
OlderNewer