Skip to content

Instantly share code, notes, and snippets.

@yannickulrich
yannickulrich / mkphoto.sh
Created May 14, 2020 08:54
Zoom Groupphoto
while true
do
gnome-screenshot -w
sleep 3
done
@yannickulrich
yannickulrich / blackout.m
Last active October 12, 2017 19:28
Turning a screen (usually an external) black in macOS
/*
Compile me with native full-screen (recommended)
curl -L https://git.io/vdiqC | gcc -DNATIVE -framework Cocoa -o ~/bin/black -x objective-c -
Compile me without native full-screen (recommended)
curl -L https://git.io/vdiqC | gcc -framework Cocoa -o ~/bin/black -x objective-c -
*/
#import <Cocoa/Cocoa.h>
#include <stdio.h>
void usage(NSString*name, NSArray*screens)
@yannickulrich
yannickulrich / beamernat.bst
Last active February 2, 2017 07:29
BibTeX style for theoretical physics talks
% vim: syntax=bst
% In some fields like theoretical particle physics it is common in
% talks to use one's initials in citations while writing the surname
% of all other authors in full. This BibTeX style allows this. Just
% change line 11 and 12.
% Example:
%
% \usepackage[square]{natbib} % Uses natbib for management
% \usepackage{bibentry} % Uses inline citation, i.e. don't
% actually print a bibliography
@yannickulrich
yannickulrich / attach
Last active September 26, 2016 06:52
Attaches file to current mail draft
#!/bin/bash
wd=`pwd`
for var in "$@"
do
file=$wd/$var
osascript <<EOF
set x to the clipboard
set notesFile to POSIX file "$file"
import Adafruit_BluefruitLE
from Adafruit_BluefruitLE.services import UART
import os
import pty
import threading
ble = Adafruit_BluefruitLE.get_provider()
class BLEbridge:
@yannickulrich
yannickulrich / LSM9DS0.py
Last active August 26, 2015 16:43
LSM9DS0 for Raspberry Pi
#!/usr/bin/env python
#!/usr/bin/env python
import Adafruit_I2C as i2c
import ctypes
import struct
import math
import tools
@yannickulrich
yannickulrich / kssh.tcl
Created October 14, 2014 16:32
Use Mac OS X Keychain to ssh. To use create keychain account for ssh://<host>
#!/usr/bin/expect -f
#log_user 0
set userhost [lrange $argv 0 0]
set userhost [split $userhost "@"]
set len [llength $userhost]
if {$len == 2} {
set user [lrange $userhost 0 0]