Skip to content

Instantly share code, notes, and snippets.

@ragingwind
ragingwind / nodemon.json
Created December 21, 2022 00:06
nodemon.json for monorepo
{
"verbose": true,
"ignore": [
"node_modules",
".next",
"package.json"
],
"watch": [
"examples/**/*",
"packages/model/src",
@ragingwind
ragingwind / IgnoreList
Created September 19, 2022 09:42
IgnoreList for Resilio Sync
# IgnoreList is a UTF-8 encoded .txt file that helps you specify single files, paths and rules
# for ignoring during the synchronization job. It supports "?" and "*" wildcard symbols.
#
#
# OS generated files #
$RECYCLE.BIN
$Recycle.Bin
System Volume Information
ehthumbs.db
desktop.ini
@ragingwind
ragingwind / hyper.js
Created January 4, 2022 12:50
hyper.js for CaskaydiaCove Nerd Font
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@ragingwind
ragingwind / .swcrc
Created November 2, 2021 02:23
swcrc
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false,
"dynamicImport": false,
"privateMethod": false,
"functionBind": false,
"classPrivateProperty": false,
"exportDefaultFrom": false,
@ragingwind
ragingwind / rgb.cpp
Created May 13, 2021 23:31
RGB Class for Modern C++
#include <iostream>
#include <string>
#include <map>
#include <cxxabi.h>
class RGB {
public:
using value_type = std::tuple<unsigned, unsigned, unsigned>;
RGB(unsigned r, unsigned g, unsigned b) : m_r(r), m_g(g), m_b(b) {}
@ragingwind
ragingwind / callstack.ts
Created October 21, 2020 00:21
Callstack for javascript
import { sep } from 'path';
function splitPath(filename, level: number) {
const paths = filename.split(sep);
return paths.splice(paths.length - level).join(sep);
}
export function caller(level: number) {
const oldStackTrace = Error.prepareStackTrace;
try {
@ragingwind
ragingwind / TypedArrayToHeap.js
Last active August 17, 2020 08:29
Allocate memory with typed array
function TypedArrayToHeap(arr) {
const { name, BYTES_PER_ELEMENT } = arr.constructor;
const prefix = name.charAt(0).replace(/I|B/, '');
const heap = Module[`HEAP${prefix}${BYTES_PER_ELEMENT << 3}`];
if (!heap) {
throw new Error(`Unknow typed array ${heap}`);
}
const ptr = Module._malloc(arr.length * BYTES_PER_ELEMENT);
heap.set(arr, ptr / BYTES_PER_ELEMENT);
@ragingwind
ragingwind / index.js
Created July 28, 2020 08:02
Simple Bridge App for ProtoPie Connect
const io = require('socket.io-client');
function main(address, message) {
const socket = io(address);
socket.on('connect', () => {
socket.emit('ppMessage', { messageId: message });
socket.disconnect();
});
}
{
"recordMap": {
"block": {
"bc607894-081d-4905-9abf-fae6f9533a44": {
"role": "reader",
"value": {
"id": "bc607894-081d-4905-9abf-fae6f9533a44",
"version": 138,
"type": "page",
"properties": {
@ragingwind
ragingwind / flipclock.html
Created August 25, 2019 20:29
Classic Flipclock
<!--
* Copyright (c) 2010 devnight.net. All rights reserved. Use of this
* source code is governed by a MIT license that can be found in the
* LICENSE file.
-->
<!DOCTYPE html>
<html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<head>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>