Skip to content

Instantly share code, notes, and snippets.

View vampy's full-sized avatar

Daniel Butum vampy

View GitHub Profile
@vampy
vampy / jokes
Created February 14, 2016 15:17
Journalist asks:
-Comrade Stalin, do you have any hobby?
-I collect jokes about me.
-And how many have you collected so far?
-About two and a half gulags
Phone call between a Russian and an Englishman. The Englishman says:
-Listen, I heard it was -60 degrees over there!
-No, it’s about -30.
-But the BBC said -60.
@vampy
vampy / MySQL.md
Last active November 25, 2016 15:16
(* Auto-generated code below aims at helping you parse *)
(* the standard input according to the problem statement. *)
(* --- *)
(* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders. *)
(* lightx: the X position of the light of power *)
(* lighty: the Y position of the light of power *)
(* initialtx: Thor's starting X position *)
(* initialty: Thor's starting Y position *)
@vampy
vampy / core-std-set.ml
Last active July 9, 2024 03:14
Example of using Set.Make on tuple int/string in Ocaml with Core.Std (janestreet core).
open Core.Std
(* See https://realworldocaml.org/v1/en/html/data-serialization-with-s-expressions.html
and https://realworldocaml.org/v1/en/html/maps-and-hash-tables.html *)
module IntTuple = struct
type t = int * int
let compare (x0, y0) (x1, y1) =
match Pervasives.compare x0 x1 with
0 -> Pervasives.compare y0 y1
#!/bin/bash
# Image https://i.imgur.com/bHVoez1.jpg
imageLocation=~/nicolascage.jpg
displayTime=0.60
newNumber (){
number=$(( $RANDOM % 600 + 60 ))
}
while true; do
#!/bin/bash
# wait for 500 ms, cuz reasosn
#
"""
Alias pwget on my machine.
wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --no-parent
"""
wget -A pdf,zip,ppt,pptx,jpg,png,xls,xlsx,zip -m -p -E -k -K -np --wait=0.5 $@
#!/usr/bin/env python3
import requests
import sys
import time
import os
from gi.repository import Notify
URL = "http://www.cs.ubbcluj.ro/~avescan/SSVV_2016/Grades/2016_SSVV_AllGrades.xls"
# One time initialization of libnotify
@vampy
vampy / awesome-pdf.md
Last active May 9, 2017 19:50
A curated list of amazingly awesome PDF programs, resources and shiny things.

Awesome PDF

PDFCrop is a Perl script that crops the white margins of PDF pages and rescales them to fit a standard size sheet of paper. It makes the printed pages far more attractive to read!

Usage

This project aims to offer a simple cross-platform application for cropping PDF files. A simple user interface lets you define exactly the crop-region by fitting a rectangle on the visually overlaid pages.

1. Get all installed packages

adb shell 'pm list packages -f' | sed -e 's/.*=//' | sort > backup_apps.txt

2. Copy all pictures

adb pull -p /mnt/sdcard/DCIM/Camera backup_pictures