Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@BonsaiDen
BonsaiDen / record.sh
Last active September 3, 2023 10:12
Record from Virtual Frame Buffer via ffmpeg
xvfb-run -s "-screen 0 1280x800x16" -e /dev/stdout -a /home/ivo/Desktop/foo.sh
./ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1280x800 -i :99 -c:v libvpx -quality realtime -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an screen.webm
# foo.sh
google-chrome --incognito --window-size=1280,800 --app=http://github.com
@m-ou-se
m-ou-se / clock.scad
Last active December 11, 2016 12:48
3D model for my whiteboard clock
$fs=1;
$fa=1;
servo_l = 24;
servo_w = 13;
servo_h = 21;
bolt_hole_diameter = 4.5;
servo_axis_diameter = 4;
@remy
remy / vat.md
Last active September 14, 2015 14:15
Testing logic for when VAT is applied

VAT Rules

Capture:

  • COUNTRY
  • VAT (optional and validated)
IF country IS "GB"
  ADD_VAT
IF country IS IN (eu) AND vat IS EMPTY
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@victorreyesh
victorreyesh / Aircrack Commands
Created September 12, 2013 03:36
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@jhass
jhass / dump_socket.sh
Last active March 6, 2024 19:32
Capture unix socket to pcap file with socat and tshark
#!/bin/bash
# Parameters
socket="/run/foo.sock"
dump="/tmp/capture.pcap"
# Extract repetition
port=9876
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig"