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
#!/usr/bin/env python3 | |
def chunks(l, n): | |
""" Yield successive n-sized chunks from l. | |
""" | |
for i in range(0, len(l), n): | |
yield l[i:i+n] | |
# uncomment as per your usage | |
#pem_key = '-----BEGIN PUBLIC KEY-----\\n' |
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
/* Pretty printing styles. Used with prettify.js. */ | |
.str { color: #080; } | |
.kwd { color: #008; } | |
.com { color: #800; } | |
.typ { color: #606; } | |
.lit { color: #066; } | |
.pun { color: #660; } | |
.pln { color: #000; } | |
.tag { color: #008; } |
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
.text-gray-dark { | |
color:white !important; | |
} |
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 <iostream> | |
#include <string> | |
#include <cassert> | |
# https://stackoverflow.com/questions/395832/how-to-get-code-point-number-for-a-given-character-in-a-utf-8-string | |
wchar_t utf8_char_to_ucs2(const unsigned char *utf8) | |
{ | |
if(!(utf8[0] & 0x80)) // 0xxxxxxx | |
return (wchar_t)utf8[0]; | |
else if((utf8[0] & 0xE0) == 0xC0) // 110xxxxx |
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
@-moz-document url-prefix("https://gist.github.com") { | |
.container { | |
width: 99%!important; | |
} | |
.gist-content { | |
margin: 0 auto; | |
width: 99%!important; | |
} | |
} |
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
read -r iterations | |
readonly iterations | |
declare -A arr | |
rows=63 | |
cols=100 | |
for ((i = 1; i <= rows; i++)); do | |
for ((j = 1; j <= cols; j++)); do | |
arr[$i,$j]=_ |
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
#!/bin/bash | |
# Script adb+ | |
# Usage | |
# You can run any command adb provides on all your currently connected devices | |
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
# | |
# Examples | |
# ./adb+ version | |
# ./adb+ install apidemo.apk | |
# ./adb+ uninstall com.example.android.apis |
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 <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#define N 6 | |
#define K 2 |
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
select repeat('* ', @n := @n + 1) from information_schema.tables, (select @n := 0) t limit 20 |
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
select repeat('* ', @n := @n - 1) from information_schema.tables, (select @n := 21) t limit 20 |