Skip to content

Instantly share code, notes, and snippets.

View alibitek's full-sized avatar
🌱
Growing

Alex Bitek alibitek

🌱
Growing
View GitHub Profile
#!/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'
/* 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; }
.text-gray-dark {
color:white !important;
}
#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
@-moz-document url-prefix("https://gist.github.com") {
.container {
width: 99%!important;
}
.gist-content {
margin: 0 auto;
width: 99%!important;
}
}
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]=_
#!/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
#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
@alibitek
alibitek / mysql_print_triangle.sql
Created June 5, 2016 11:53
MySQL print triangle
select repeat('* ', @n := @n + 1) from information_schema.tables, (select @n := 0) t limit 20
@alibitek
alibitek / mysql_print_reverse_triangle.sql
Last active June 5, 2016 11:53
MySQL print reverse triangle
select repeat('* ', @n := @n - 1) from information_schema.tables, (select @n := 21) t limit 20