Skip to content

Instantly share code, notes, and snippets.

View davidgarsan's full-sized avatar
💩
entropy

David davidgarsan

💩
entropy
View GitHub Profile

Cheat sheet: classes in JavaScript

Basic members of classes

class OtherClass {}

class MyClass1 extends OtherClass {

  publicInstanceField = 1;
@surma
surma / .gitignore
Last active June 17, 2022 18:53
Moving a Three.JS-based WebXR app to a worker
node_modules
build
package-lock.json
@bgulla
bgulla / jetson_nano_cheatsheet.md
Last active September 5, 2022 21:29
Notes related to the NVIDIA Jetson Nano dev kit

Jetson Nano Cheatsheet

image text

Below are my personal notes related to the Nvidia Jetson Nano Dev-board.

Performance Management

Nvidia allows your to fine tune the performance of your Jetson nano. More on this here.

Show the current settings

sudo /usr/bin/jetson_clocks.sh --show
@chrislopresto
chrislopresto / component.tsx
Created September 10, 2018 20:12
styled-components v4 + createGlobalStyle + TypeScript
import * as React from 'react';
import { theme } from './theme';
import { ThemeProvider, createGlobalStyle } from './styled-components';
const GlobalStyle = createGlobalStyle`
body {
font-family: Times New Roman;
}
`;
@developit
developit / *state-machine-component.md
Last active February 6, 2021 00:44
265b lib for building pure functional state machine components. https://github.com/developit/state-machine-component

state-machine-component

A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo

Usage

The API is a single function that accepts 2 pure functions as arguments:

@cschiewek
cschiewek / x11_docker_mac.md
Last active May 24, 2024 10:48
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@SitePointEditors
SitePointEditors / dom-helper.js
Created March 28, 2017 09:56 — forked from m3g4p0p/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@alexellis
alexellis / timelapse.md
Created March 9, 2017 08:48 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@bvaughn
bvaughn / gist:3a358dda3654e1e93fba35890a093c19
Created May 14, 2016 20:20
Example Grid with columns and rows, built using :cellRangeRenderer (with react-virtualized 7.x)
/** @flow */
import Immutable from 'immutable'
import React, { Component, PropTypes } from 'react'
import { ContentBox, ContentBoxHeader, ContentBoxParagraph } from '../demo/ContentBox'
import { LabeledInput, InputRow } from '../demo/LabeledInput'
import AutoSizer from '../AutoSizer'
import Grid from './Grid'
import shallowCompare from 'react-addons-shallow-compare'
import cn from 'classnames'
import styles from './Grid.example.css'
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software