Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / CrossOver.sh
Last active April 19, 2024 04:55
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@vittorioromeo
vittorioromeo / hello_triangle.cpp
Created October 10, 2015 11:07
SDL2 + OpenGL ES 2.0 - "Hello triangle" example that works both on X11 and Emscripten
#include <exception>
#include <functional>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
@harkabeeparolus
harkabeeparolus / Typer_cheat_sheet.md
Last active April 19, 2024 04:53
Typer — my attempt at reference documentation
@WebD00D
WebD00D / debounce.ts
Created October 9, 2019 00:17
Debounce React Hook
import React, { useState, useEffect } from 'react';
const debounce = (value, delay) => {
// State and setters for debounced value
const [debouncedValue, setDebouncedValue] = useState(value);
useEffect(
() => {
// Set debouncedValue to value (passed in) after the specified delay
/**************************************************************************/
/*!
@brief Custom lookup tables for full screen updates. Public domain (?) from Waveshare.
@note Video explainer: https://www.youtube.com/watch?v=MsbiO8EAsGw and more info:
https://benkrasnow.blogspot.com/2017/10/fast-partial-refresh-on-42-e-paper.html
@warning YOU CAN PERMANENELY DAMAGE YOUR DISPLAY BY ABUSING THESE LOOKUP TABLES!
Seriously, the controller is incredibly programmable and you can force all
kinds of voltages and timings onto the screen that it wasn't meant to deal
with. TWEAK AT YOUR OWN RISK!
*/
@schmich
schmich / termbin-encrypted-data.md
Last active April 19, 2024 04:47
Sharing encrypted data via termbin.com with only netcat and OpenSSL

Single file

Source

  • cat /foo/bar/file.txt | openssl enc -aes-256-cbc -base64 | nc termbin.com 9999
  • Enter password twice (quickly), note termbin.com URL

Destination

  • curl -s http://termbin.com/{id} | openssl enc -aes-256-cbc -base64 -d &gt; file.txt
@joeycastillo
joeycastillo / grayscale.ino
Created January 21, 2020 15:51
Display grayscale images on a GDEW042T2 e-paper display
// library here: https://github.com/joeycastillo/The-Open-Book/tree/master/src
// convert images with this tool: https://littlevgl.com/image-to-c-array
// options: Indexed 4 colors, output format binary. Do the dithering on your own,
// and make sure your four colors include pure white and pure black.
#include <OpenBook.h>
#include <SD.h>
OpenBook *book;
// or for using your own 4.2" B&W display (substitute your pin assignments):
@bvaughn
bvaughn / index.md
Last active April 19, 2024 04:34
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@rtviii
rtviii / masif.py
Created April 19, 2024 04:32 — forked from edraizen/masif.py
MaSIF pymol plugin, merged to avoid finding correct paths
# Pablo Gainza Cirauqui 2016 LPDI IBI STI EPFL
# This pymol plugin for Masif just enables the load ply functions.
import os, sys
import math, re
from pymol import cmd, stored
import sys
from pymol import cmd, stored