Skip to content

Instantly share code, notes, and snippets.

View LucasAlfare's full-sized avatar
💭
Attempting "masterize" JetPack Compose

Francisco Lucas LucasAlfare

💭
Attempting "masterize" JetPack Compose
  • Imperatriz - MA, Brazil
  • 12:19 (UTC -12:00)
View GitHub Profile
@berkus
berkus / xbox-one-wireless-protocol.md
Created April 4, 2019 13:21 — forked from alfredkrohmer/xbox-one-wireless-protocol.md
XBox One Wireless Controller Protocol

Physical layer

The dongle itself is sending out data using 802.11a (5 GHz WiFi) with OFDM and 6 Mbit/s data rate:

Radiotap Header v0, Length 38
    Header revision: 0
    Header pad: 0
    Header length: 38
    Present flags
@fnky
fnky / ANSI.md
Last active May 19, 2024 22:45
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
package sample;
public class BinaryReader {
enum Endian {
Little,
Big
}
private Endian endianness;
public BinaryReader(Endian endian) {
this.endianness = endian;
@cezarguimaraes
cezarguimaraes / ioitems.lua
Last active November 2, 2019 00:25
Parse tibia dat files
local vstruct = require 'vstruct'
function Items(path)
local buffer = io.open(path, 'rb')
local signature = vstruct.readvals('u4', buffer)
local itemCount, creatureCount, effectCount, distanceCount = vstruct.readvals('4 * u2', buffer)
local items = {}
package org.rogach.jopenvoronoi;
import java.io.*;
import java.util.*;
import java.awt.geom.Point2D;
import java.awt.Color;
// random polygon generator
// uses space partitioning algorithm, described here: http://www.geometrylab.de/applet-29-en#space
public class RandomPolygon {
@cs0x7f
cs0x7f / SkewbSolver.java
Created January 4, 2014 05:38
Verify whether all states of the skewb can be solved at exactly 11 moves.
package puzzle;
import java.util.Random;
public class SkewbSolver {
private static final int[] fact = { 1, 1, 1, 3, 12, 60, 360 };//fact[x] = x!/2
private static char[][] permmv = new char[4320][4];
private static char[][] twstmv = new char[2187][4];
@biovisualize
biovisualize / index.html
Last active February 21, 2023 21:08
Fast pixel drawing on canvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
</style>
</head>
@nhunzaker
nhunzaker / animationLoop
Created August 27, 2012 00:07
JS: requestAnimationFrame Loop Pattern
/*
TIME BASED ANIMATION:
---------------------
To keep things moving at a constant time-based rate instead of varying
frame-based, multiply your movement by APP.deltaTime
BAD: 100 pixels per frame (BOO... movement is tied to framerate)
var velocity = 100;
BETTER: 100 pixels per second (Horray! Framerate independence!)
import java.io.FileReader;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created with IntelliJ IDEA.
* User: smevok
* Date: 05.07.12
@banthar
banthar / Split.java
Created June 13, 2012 10:33
java split benchmark
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class Split {
private static String string = "a/b/c/d/e/f/g/h/i/j/asd/asdas/dasdjasodjoa/sjd/oajs/djoasjd/as/odj/jaowdj/oajw/odj/aojwd/oja/owjd/oja/wjdoja/wdj/awjdojaw/odj/oawjd/oja/wjdoawjdojaw/d/dff";