Skip to content

Instantly share code, notes, and snippets.

@joymon
joymon / scientific_debugging_template.md
Last active May 21, 2024 19:17
Scientific debugging template to track progress

Status - [Open/Closed]

Overview

  • Reported on - [Date]
  • Last updated on - [Date]
  • Environment - [All/Staging/Prod/QA/Dev]
  • Investigators
    • Person 1
    • Person 2

Description

@gilankpam
gilankpam / redux-request-success-failure.js
Last active May 17, 2022 14:04
redux-request-success-failure.js
function reduxHelper (actionName, fn) {
if (typeof actionName !== 'string') {
throw new Error('actionName must be a string')
}
if (typeof fn !== 'function') {
throw new Error('fn must be a function')
}
const actionNameUpper = actionName.toUpperCase()
const actionRequest = actionNameUpper + '_REQUEST'
const actionSuccess = actionNameUpper + '_SUCCESS'
@vicrucann
vicrucann / bezier.frag
Last active February 24, 2024 23:00
GLSL shader that allows to draw smooth and thick Bezier lines in 3D; added fog effect; using OpenSceneGraph for visualization
#version 330
in VertexData{
vec4 mColor;
} VertexIn;
void main(void)
{
gl_FragColor = VertexIn.mColor;
}
@crcastle
crcastle / ESP8266 Code (RX node)
Last active December 15, 2022 23:36
Trying to use NRF24L01+ on ESP8266, using the ESP8266 as MCU (i.e. not an Arduino or ATmega328). See https://github.com/esp8266/Arduino for details on initial setup of ESP8266 as Arduino-compatible MCU. The serial output below does not show expected messages: a) the full output shows up all at once then stops dead and b) the values for _salt, vo…
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
RF24 radio(15, 15); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8
// Topology
const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };
@tracker1
tracker1 / 01-directory-structure.md
Last active May 3, 2025 04:36
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@cararemixed
cararemixed / .gitconfig
Last active November 15, 2018 15:46
Git URL shortcuts
[url "https://github.com/"]
insteadOf = git://github.com/
insteadOf = [email protected]:
insteadOf = gh:
insteadOf = github:
[url "https://github.com/standard-analytics/"]
insteadOf = sa:
[url "https://git.apache.org/repos/asf/"]
insteadOf = apache:
[url "https://github.com/strmpnk/"]
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 6, 2025 10:00
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@bistaumanga
bistaumanga / gmm.py
Last active September 26, 2024 10:00
Gaussian Mixture Model using Expectation Maximization algorithm in python
# -*- coding: utf-8 -*-
"""
Created on Sat May 3 10:21:21 2014
@author: umb
"""
import numpy as np
class GMM:
@stevenh512
stevenh512 / gitconfig-git
Created June 11, 2012 10:51
URL rewriting in .gitconfig
# Use git and git+ssh instead of https
[url "git://github.com/"]
insteadOf = https://github.com/
[url "[email protected]:"]
pushInsteadOf = "git://github.com/"
[url "[email protected]:"]
pushInsteadOf = "https://github.com/"