Skip to content

Instantly share code, notes, and snippets.

View 000alen's full-sized avatar

Alen Rubilar-Muñoz 000alen

View GitHub Profile
@aidos-dev
aidos-dev / README.md
Last active February 25, 2026 22:48
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@Nachasic
Nachasic / react-serialize.spec.tsx
Last active March 10, 2025 18:50
Serialize react to JSON and de-serialize it back with TypeScript
import * as React from 'react';
import { mount } from 'enzyme';
import { serialize, deserialize } from './react-seritalize';
class CustomComponent extends React.Component<any, any> {
render () {
return <div className="CustomComponent" >{this.props.children}</div>
}
}
@ansemjo
ansemjo / uuid-hash.ts
Created January 6, 2017 14:39
Hashing wrapper in TypeScript, which can use stable-stringify to convert any object to a UUID or just make hashing a little easier.
/** For use in node.js environments.
* Requires npm packages:
* "@types/json-stable-stringify": "^1.0.29"
* "json-stable-stringify": "^1.0.1"
* "@types/uuid": "^2.0.29"
* "uuid": "^3.0.1"
*/
import * as uuid from 'uuid';
import * as crypto from 'crypto';
@G33kDude
G33kDude / vm.py
Last active April 15, 2018 22:30
import os
import struct
import sys
INTRANGE = 2 ** 15
REGCOUNT = 8
class Arch:
def __init__(self):
self.registers = [0] * REGCOUNT
@DmitrySoshnikov
DmitrySoshnikov / LL1-parsing-table.js
Last active February 15, 2023 14:55
LL(1) Parser. Parsing table, part 2: building the table from First and Follow sets.
/**
* Building LL(1) parsing table from First and Follow sets.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style License
*
* This diff is a continuation of what we started in the previous two diffs:
*
* Dependencies:
*
@briancavalier
briancavalier / serialize-function.js
Created February 10, 2015 18:34
Serializing / deserializing JavaScript functions *with free variables*
var a = 123, b = 'hello';
function test(x, y) {
console.log(this);
return a + x + b + y;
}
// Serialize a function *with its captured environment*
var sf = serialize(test, { a: a, b: b });
// Deserialize with captured environment
@katylava
katylava / git-selective-merge.md
Last active February 11, 2026 09:00
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.