Skip to content

Instantly share code, notes, and snippets.

alias hello='echo hello'
alias l1='ls -1'
alias lll='ls -ltr'
alias rmr="rm -r"
alias rm.="rm -r \$(pwd); cd .."
alias grepcode='grep -rnI'
alias dclear='clear && clear'
alias ~='cd ~'
package com.maanoo.kickassist;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Scanner;
/**
* Check and upgrades to a new version.
function random_password(length) {
var characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var password = "";
for (var i = 0; i < length; i++) {
var random_float = Math.random();
password += characters.charAt(Math.floor(random_float * characters.length));
}
// run with:
// g++ --std=c++14 -O3 eucl_variations.cpp && ./a.out && rm a.out
// output:
// 12139783
// 7026125
// 5667812
// 12146435
// 7126185
@MaanooAk
MaanooAk / non-text text.txt
Created May 4, 2017 10:48
Some non-text mime-types which are text
application/javascript
application/x-javascript
application/ecmascript
application/json
application/xml
@MaanooAk
MaanooAk / skiplist.h
Created April 27, 2017 13:15 — forked from unsuthee/skiplist.h
C++ Implementation of Skiplist
///////////////////////////////////////////////////////////////////////////////
#ifndef _SKIPLIST_H_
#define _SKIPLIST_H_
#include <iostream>
#include <sstream>
///////////////////////////////////////////////////////////////////////////////
/**
* Moves a given path form a folder to an other.
*/
public static Path movePath(Path path, Path from, Path to) {
return to.resolve(from.relativize(path));
}
#!/bin/sh
name=$(date '+%y-%m-%d-%H-%M')
systemd-analyze plot > ~/Documents/Boots/$name.svg
systemd-analyze > ~/Documents/Boots/$name.txt
systemd-analyze critical-chain >> ~/Documents/Boots/$name.txt
systemd-analyze blame >> ~/Documents/Boots/$name.txt
@MaanooAk
MaanooAk / minify-js.sh
Created December 28, 2016 10:37 — forked from gurdiga/minify-js.sh
JS minifying script with curl and Closure Compiler REST API
#!/bin/sh
# Use like this:
#
# minify-js.sh < app.js > app.min.js
#
curl -s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \