This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addRoundKey(block, words, round) { | |
| const result = [] | |
| for (let i = 0; i < 16; i++) | |
| result[i] = block[i] ^ words[round][i] | |
| return result | |
| } | |
| const shift = [0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3] | |
| function shiftRows(block) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {JSCallback, CString} from 'bun:ffi' | |
| import {encodeCString, default as lib} from './lib' | |
| export class Webview { | |
| static #instances = [] | |
| static unload() { | |
| for (const instance of this.#instances) | |
| instance.destroy() | |
| lib.close() | |
| } | |
| #handle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.from({length: 26}, (_, i) => String.fromCharCode(97 + i)) | |
| Array(26).fill().map((_, i) => String.fromCharCode(97 + i)) | |
| [...Array(26).keys()].map(i => String.fromCharCode(97 + i)) | |
| [...Array(26)].map((_, i) => String.fromCharCode(97 + i)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Twitch { | |
| #event = new EventTarget | |
| on(...data) { | |
| this.#event.addEventListener(...data) | |
| } | |
| removeListener(...data) { | |
| this.#event.removeEventListener(...data) | |
| } | |
| #capabilities = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local uv = require('uv') | |
| local gpio = require('./wiringPi.lua') | |
| gpio.wiringPiSetup() | |
| local led = 2 | |
| local led_state = gpio.digitalRead(led) | |
| gpio.pinMode(led, 1) -- OUTPUT | |
| while true do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local ffi = require('ffi') | |
| local lib = ffi.load('libpilwgpio.so') -- https://github.com/besp9510/pi_lw_gpio | |
| -- GPIO operation function prototypes: | |
| ffi.cdef[[ | |
| int gpio_set(int p); | |
| int gpio_clear(int p); | |
| int gpio_read_level(int p); | |
| int gpio_set_mode(int mode, int p); | |
| int gpio_read_mode(int p); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function rps(game, a, b) { | |
| if (a == b) return 0 // Tie | |
| const r = game.indexOf(a) - game.indexOf(b) | |
| // An even number will decide "A" winner for positive numbers, odd for negative | |
| return r % 2 == (r < 0 ? 0 : 1) | |
| } | |
| // Game elements lenght must be an odd number | |
| const games = [ | |
| [ // Original |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const types = { | |
| 100(data, position) { // d | |
| position[0]++ | |
| const dictionary = {} | |
| while (data[position[0]] !== 101) dictionary[buffer(data, position)] = decode(data, position) | |
| position[0]++ | |
| return dictionary | |
| }, | |
| 108(data, position) { // l | |
| position[0]++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style> | |
| body { | |
| background: #fff; | |
| user-select: none; | |
| overflow: hidden; | |
| margin: 0; | |
| } | |
| #loading_box { | |
| background: #252525; | |
| padding: 0.5%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Client | |
| clientParticles = {} | |
| RegisterNetEvent('ClientParticle') | |
| AddEventHandler('ClientParticle', function(player, name, dictionary, pos, rot, bone, scale) | |
| if pos then | |
| local ped = GetPlayerPed(GetPlayerFromServerId(player)) | |
| RequestNamedPtfxAsset(dictionary) |