Skip to content

Instantly share code, notes, and snippets.

View mukhortov's full-sized avatar
:octocat:

Peter Mukhortov mukhortov

:octocat:
View GitHub Profile
@mukhortov
mukhortov / usbreset.c
Last active January 16, 2022 09:02 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
* */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@mukhortov
mukhortov / remap_section_to_esc.sh
Last active April 30, 2018 20:05 — forked from lauri/gist:84674ab22aafc4e0f398a52a53cfd7ec
Remap section sign key (§) to ESC (useful if you have a MacBook Pro with touch bar)
#!/bin/bash
#
# Remap section sign key (§) to ESC
#
# 0x700000064 - section sign (§) key below ESC
# 0x700000029 - ESC
#
# https://developer.apple.com/library/content/technotes/tn2450/_index.html
#
@mukhortov
mukhortov / rotate.less
Last active August 29, 2015 14:15 — forked from swider/rotate.less
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;