Skip to content

Instantly share code, notes, and snippets.

Avatar
Consuming coffee

Tim Visée timvisee

Consuming coffee
View GitHub Profile
View x11_clip_and_revert.rs
/// 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::{
View my-subreddits.txt
11foot8
18650masterrace
1911
2b2t
3Dprinting
3dshacks
3kliksphilip
45thworldproblems
5September2020
9CB9D65
View barbapappa-routes.txt
$ ./artisan route:list
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+----
View snippet-correctly-capitalize-names-in-php.md
@timvisee
timvisee / .vimrc
Created Jun 28, 2019
Greatly reduced vimrc base for @eloydegen
View .vimrc
""" 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'
View ffsend_generic_crypto_streams_1.rs
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,
View arduino-ultra-sone.ino
/*
* Ultrasonic Sensor HC-SR04 and Arduino Tutorial
*
* by Dejan Nedelkovski,
* www.HowToMechatronics.com
*
*/
// defines pins numbers
const int trigPin = 9;
View packettracer-deps.txt
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
View nightly-nalgebra.log
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
View points-to-angles.rs
extern crate nalgebra;
use nalgebra::geometry::Point3;
/// Given a list of points, calculate the rotation/angle the edges between points in radians.
///
/// In order to make reliable calculations the first two points are dropped in the result.
/// If a list of less than 3 points is given, an emtpy result is returned.
fn calc_point_angles(points: &Vec<Point3<f64>>) -> Vec<f64> {
points