Skip to content

Instantly share code, notes, and snippets.

View yossale's full-sized avatar
💭
I may be slow to respond.

Yossale yossale

💭
I may be slow to respond.
View GitHub Profile
@ahtcx
ahtcx / deep-merge.js
Last active April 29, 2024 17:13
Deep-Merge JavaScript objects with ES6
// ⚠ IMPORTANT: this is old and doesn't work for many different edge cases but I'll keep it as-is for any of you want it
// ⚠ IMPORTANT: you can find more robust versions in the comments or use a library implementation such as lodash's `merge`
// Merge a `source` object to a `target` recursively
const merge = (target, source) => {
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
for (const key of Object.keys(source)) {
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key]))
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jskorpan
jskorpan / StringTokenizer.java
Created June 30, 2011 11:37 — forked from cgbystrom/StringTokenizer.java
Ultra fast Java string tokenizer
public class StringTokenizer {
private static ThreadLocal<String[]> tempArray = new ThreadLocal<String[]>();
public static String[] tokenize(String string, char delimiter)
{
String[] temp = tempArray.get();
int tempLength = (string.length() / 2) + 2;
if (temp == null || temp.length < tempLength)
{