Skip to content

Instantly share code, notes, and snippets.

View Techcable's full-sized avatar
🇺🇸
Procrastinating

Techcable

🇺🇸
Procrastinating
View GitHub Profile
@jboner
jboner / latency.txt
Last active May 8, 2024 16:32
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
@karussell
karussell / GridTraversal.java
Created July 10, 2014 22:38
Fast Voxel Grid Traversal Algorithm
public static void calcPoints( double y1, double x1, double y2, double x2,
PointEmitter emitter )
{
int x = (int) x1, y = (int) y1;
int endX = (int) x2, endY = (int) y2;
// deltaX and Y is how far we have to move in ray direction until we find a new cell in x or y direction
// y = u + t * v, where u=(x1,x2) and v=(stepX,stepY) is the direction vector
final double gridCellWidth = 1, gridCellHeight = 1;
@esamson
esamson / .gitignore
Last active April 28, 2019 14:56
systemd service file for sonatype nexus. Put this in `$HOME/.config/systemd/user/nexus.service`. Launch with `systemctl --user start nexus`.
default.target.wants/
nexus
@aikar
aikar / EmpireCommand.java
Created June 9, 2015 02:43
Empire Minecraft's Command System
package com.empireminecraft.commands;
import com.empireminecraft.commands.annotation.CommandAlias;
import com.empireminecraft.commands.annotation.CommandPermission;
import com.empireminecraft.commands.annotation.Default;
import com.empireminecraft.commands.annotation.Subcommand;
import com.empireminecraft.config.EmpireServer;
import com.empireminecraft.config.PlayerSettingKey;
import com.empireminecraft.config.language.MiscLang;
import com.empireminecraft.data.EmpireUser;
package com.empireminecraft.commands;
import com.empireminecraft.commands.annotation.CommandAlias;
import com.empireminecraft.commands.annotation.CommandPermission;
import com.empireminecraft.commands.annotation.Default;
import com.empireminecraft.commands.annotation.Subcommand;
import com.empireminecraft.config.EmpireServer;
import com.empireminecraft.config.PlayerSettingKey;
import com.empireminecraft.config.language.MiscLang;
import com.empireminecraft.data.EmpireUser;
yamlScalar ::= VALUE
yamlFile ::= yamlDocument*
yamlDocument ::= DOCUMENT_START yamlContent* DOCUMENT_END | DOCUMENT_START yamlContent* | yamlContent*
yamlContent ::= yamlBlock | COMMENT
yamlBlock ::= yamlMap | yamlSequence
yamlMap ::= yamlNormalMap | yamlFlowMap
yamlNormalMap ::= yamlKey MAP_SEPARATOR (CRLF | COMMENT)* (yamlBlock | yamlScalar)
@glampert
glampert / stack_machine.cpp
Created March 22, 2017 17:59
1-register stack caching test for stack-based interpreters.
//
// Simple stack-based virtual machine tests.
//
// I use two slightly different strategies to manage the
// interpreter stack: First is using the "naive" approach
// of keeping a stack pointer that is bumped/decremented
// for every instruction that has stack operands. The second
// approach uses a "stack cache" register to cache the
// Top-of-Stack (TOS) value.
//
@kearlsaint
kearlsaint / Pulse_SMSBackup.js
Last active October 27, 2019 12:47
Snippet of code to create a full XML backup of messages from Pulse Messenger
/*!
*
* Snippet of code to create a full XML backup of messages from Pulse Messenger
* https://github.com/klinker-apps/messenger-desktop
*
* This code utilizes the webapp's core functions.
*
* Instructions
* 1. Log into https://messenger.klinkerapps.com
* 2. Wait for the UI to load your conversations
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 7, 2024 12:32
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@jfcherng
jfcherng / st4-changelog.md
Last active April 20, 2024 00:25
Sublime Text 4 changelog just because it's not on the official website yet.