Skip to content

Instantly share code, notes, and snippets.

View fantix's full-sized avatar
🤯

Fantix King fantix

🤯
View GitHub Profile
@findmory
findmory / README.md
Last active October 3, 2024 06:36
Send Trackpad gestures over Barrier/Synergy using BetterTouchTool

Problem: Controlling a remote Mac desktop using a tool like Barrier or Synergy doesn't allow for trackpad gestures to be sent to the client machine.

Solution: Use Better Touch Tool on host machine to handle the gestures and send a remote command to the client machine.

Steps to setup:

[1] On the CLIENT machine in BTT setup these Named triggers:

@tkrs
tkrs / parser.go.y
Created February 13, 2018 05:31
goyacc tutorial
%{
package main
import (
"text/scanner"
"strconv"
"strings"
"fmt"
)
type Expression interface{}
type ParenExpr struct {
@Vestride
Vestride / encoding-video.md
Last active October 13, 2024 16:57
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@llllllllll
llllllllll / namedtuple.c
Last active September 9, 2022 14:49
namedtuple.c
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <Python.h>
#include <structmember.h>
#include <frameobject.h>
@gavinhungry
gavinhungry / nginx-tls.conf
Last active July 18, 2024 11:35
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@ewestern
ewestern / chpt4.py
Last active December 14, 2018 07:02
A python implementation of TAPL chpt 4
import ply.lex as lex
import ply.yacc as yacc
dummyinfo = ''
class Term(object):
def __init__(self, info):
self.info = info
@aoxu
aoxu / coc_3.md
Last active November 2, 2016 13:48
Clash of Clans攻略(三):防守~

#Clash of Clans攻略(三):防守~ ##引言 防守的很多技巧是跟进攻密不可分的,从进攻的过程中学习别人的防守技巧,会有助于改善自己的防守。

##防守类建筑

  1. 加农炮(CANNON)。单体攻击,只能对地,攻击力和射程中规中矩。面对人海战术时比较无力,适合补刀。
  2. 箭塔。单体攻击,对地对空,攻击力与加农炮差不多,但是射程很远。适合扩展防守范围,以及防气球流。
  3. 主炮(MORTAR)。溅射攻击,只能对地,攻击力较高,射程最远(比箭塔还远1格)。适合主力输出。
  4. 魔法塔(也叫巫师塔)。溅射攻击,对地对空。攻击力高,射程很短。适合贴身守护核心。成本较高。
  5. 防空塔。单体攻击,只能对空。攻击超高!适合主力对空。
@jboner
jboner / latency.txt
Last active November 4, 2024 07:23
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD