Skip to content

Instantly share code, notes, and snippets.

View kilisio's full-sized avatar
👓
One line of code at a time...

Patrick Kilisio kilisio

👓
One line of code at a time...
View GitHub Profile
import {extname} from 'path'
import {build, stop} from 'esbuild'
import {solidPlugin} from 'esbuild-plugin-solid'
import {denoPlugin} from 'esbuild_deno_loader'
const [input] = Deno.args
const ext = extname(input)
const compileOutput = input.replace(ext, '.compiled.js')
const bundleOutput = input.replace(ext, '.bundle.js')
@Jake-Shadle
Jake-Shadle / xwin.dockerfile
Last active May 13, 2024 13:40
Example dockerfile for cross compilation of `x86_64-pc-windows-msvc` Rust binaries in a Linux container
# We'll just use the official Rust image rather than build our own from scratch
FROM docker.io/library/rust:1.54.0-slim-bullseye
ENV KEYRINGS /usr/local/share/keyrings
RUN set -eux; \
mkdir -p $KEYRINGS; \
apt-get update && apt-get install -y gpg curl; \
# clang/lld/llvm
curl --fail https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > $KEYRINGS/llvm.gpg; \
List with Compatible devices:
Look under About on the watch for the device Id.
looks something like this:
MOY-TEH5-1.7.7
the middle section is the interesting part, if that is in this list here
it has the compatible bootloader and the same pinout as pinetime for Display and External Flash
@szekelyisz
szekelyisz / pio-lwip2-esp8266-arduino-rebuild.md
Last active January 13, 2024 22:40
Recompiling LwIP for PlatformIO ESP8266 Arduino framework

Recompiling LwIP2 for PlatformIO ESP8266 Arduino framework

In case, for example, you want to debug it.

  1. Make sure your ~/.platformio/packages/framework-arduinoespressif8266 is a git repository. You can run git status in that directory to find out. If it's not, remove the entire directory and rebuild you sketch. This will pull the stable granch from the official repository. All following paths are relative to this directory.
  2. Install the toolchain: cd tools && ./get.py.
  3. Edit LwIP2 source code which is under sdk/lwip2/builder/lwip2-src. If you just want to change the build options, edit sdk/lwip2/builder/glue-lwip/arduino/lwipopts.h accordingly.
  4. Still in tools, cd to sdk/lwip2.
  5. Run make install.
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active July 15, 2024 08:59
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@d-a-v
d-a-v / tcpCleanup-snippet.ino
Last active January 1, 2024 09:22
portable way to clear tcp pcb in time-wait (esp8266/Arduino) - tcpCleanup() fix for lwip2
// https://github.com/esp8266/Arduino/issues/1923
// https://github.com/esp8266/Arduino/issues/4213
// compatible with lwip-v1 and -v2
// no need for #include
struct tcp_pcb;
extern struct tcp_pcb* tcp_tw_pcbs;
extern "C" void tcp_abort (struct tcp_pcb* pcb);
void tcpCleanup ()
@xiaokangwang
xiaokangwang / ubuntu-cli-install-android-sdk.sh
Last active September 13, 2023 19:16 — forked from zhy0/ubuntu-cli-install-android-sdk.sh
Install Android SDK on headless Ubuntu linux machine via command line, so that you can compile open source Android apps.
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make expect # NDK stuff