Skip to content

Instantly share code, notes, and snippets.

View timvisee's full-sized avatar
Consuming coffee

Tim Visée timvisee

Consuming coffee
View GitHub Profile
@timvisee
timvisee / Head.php
Last active March 14, 2022 14:57
MCDragonRealms Minecraft player head avatar class.
<?php
/**
* MCDragonRealms Minecraft player head avatar class.
*
* This class is able to generate player avatars based on any Minecraft player skin.
*
* Use the `p` GET param when doing direct HTTP requests to this file to set the avatar type, size and username. (p=TYPE/SIZE/USERNAME)
*
* Current supported types are (as you can see at the bottom of the script):
@timvisee
timvisee / apbf-pin.sh
Created June 16, 2021 14:29
https://github.com/timvisee/apbf for 4 or 5 digit PIN ending with 7
#!/bin/bash
# Loop through all 4 and 5 digit combinations
for pin in $(seq -f "%04g" 0 99999)
do
# Skip all pins not ending with 7
[[ $pin == *7 ]] || continue
# Test code
echo "Testing: $pin"
pub fn main() {
println!(
"{}",
// Read puzzle input
include_bytes!("../input.txt")
// For each line (each 10 character sequence, and a newline)
.chunks(11)
// Process the 10 character sequence, ignore the newline
.map(|b| b[..10]
.iter()
@timvisee
timvisee / .vimrc
Created June 28, 2019 14:29
Greatly reduced vimrc base for @eloydegen
""" Configure vim-plug
set nocompatible
filetype off
" Begin vim-plug plugin loading
call plug#begin('~/.local/share/nvim/plugged')
" Jumping
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
/// Copy with timeout on X11.
///
/// Keeps clipboard contents in clipboard even if application quits. Doesn't fuck with other
/// clipboard contents and reverts back to previous contents once a timeout is reached.
///
/// Forks & detaches two processes to set/keep clipboard contents and to drive the timeout.
///
/// Based on: https://docs.rs/copypasta-ext/0.3.2/copypasta_ext/x11_fork/index.html
fn copy_timeout_x11(data: &[u8], timeout: u64) -> Result<()> {
use copypasta_ext::{
$ ./artisan route:list
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+----
use std::cmp;
use std::io::{self, BufRead, BufReader, Cursor, Error as IoError, Read, Write};
use bytes::{BufMut, BytesMut};
use ece::Aes128GcmEceWebPush;
/// The cryptographic mode for a crypter: encrypt or decrypt.
pub enum CryptMode {
/// Encrypt data while transforming.
Encrypt,
/*
* Ultrasonic Sensor HC-SR04 and Arduino Tutorial
*
* by Dejan Nedelkovski,
* www.HowToMechatronics.com
*
*/
// defines pins numbers
const int trigPin = 9;
Qt module dev package lib package
-------------------------------------------------------------------------
bluetooth qtconnectivity5-dev libqt5bluetooth5
concurrent qtbase5-dev libqt5concurrent5
connectivity qtmobility-dev libqtconnectivity1
contacts qtmobility-dev libqt5contacts5
core qtbase5-dev libqt5core5a
dbus qtbase5-dev libqt5dbus5
designer qttools5-dev libqt5designer5
designercomponents qttools5-dev libqt5designercomponents5
Compiling num-traits v0.2.6
Compiling typenum v1.10.0
Compiling num-complex v0.2.1
Compiling matrixmultiply v0.1.14
Checking rand_core v0.3.0
Checking rawpointer v0.1.0
Checking libc v0.2.43
Checking libm v0.1.2
Checking rand_core v0.2.2
Checking rand v0.5.5