Skip to content

Instantly share code, notes, and snippets.

View malex984's full-sized avatar
😎
looking forward to my new job

Oleksandr Motsak malex984

😎
looking forward to my new job
View GitHub Profile
@achidlow
achidlow / humble_bundle_download.py
Last active September 10, 2022 20:44
Download all the books in a humble bundle.
"""
Script to download all the books in a humble bundle.
May work for other resources, but don't have anything to test against.
To use, run from the directory you want to download the books in.
Pass the "game" key as the first argument (look in the URL of your normal download page).
To restrict to certain formats, pass them as extra positional arguments on the command line.
Example:
python humble_bundle_download abcdef12345 mobi pdf
@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@gorango
gorango / screencast.md
Last active January 7, 2023 04:28
Uses CVLC (command-line VLC) to record a screen session in Linux.

Linux screen capture

Uses CVLC (command-line VLC) to record an ongoing screen session in Linux.

Requires VLC to be installed.

Usage

To save a new video file in the current folder:

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 23:08
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@malex984
malex984 / .ssh_config
Last active December 6, 2016 04:00
Configuration in YAML
Host *
ForwardX11=no
StrictHostKeyChecking=no
BatchMode=yes
PasswordAuthentication=no
UserKnownHostsFile=/dev/null
LogLevel=quiet
ConnectionAttempts=3
ConnectTimeout=10
ControlMaster=no
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@rgaidot
rgaidot / build_rancheros_for_rpi.sh
Created May 24, 2016 08:52
Build RancherOS for Raspberry Pi
#!/bin/zsh
git clone https://github.com/rancher/os.git
cd os/scripts/images/rpi-hypriot
docker build -f Dockerfile.dapper --pull -t rancheros/rpi .
docker run -ti --privileged -v `pwd`/scripts/build.sh:/source/scripts/build.sh -v `pwd`/dist:/source/dist rancheros/rpi
echo ---
echo Done!
echo Now you can unzip rancheros-rpi2.zip in os/scripts/images/rpi-hypriot/dist
@graymouser
graymouser / hb_all_books_dl.js
Created February 28, 2016 14:09
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});
@tullmann
tullmann / waitForX
Created November 13, 2015 19:02
wait for an X11 server to be ready (good for running under XVFB when testing chrome)
#!/bin/bash
#
# waitForX [<cmd> [<arg> ...]]
#
# Wait for X Server to be ready, then run the given command once X server
# is ready. (Or simply return if no command is provided.)
#
function LOG {
echo $(date -R): $0: $*