Skip to content

Instantly share code, notes, and snippets.

View nn1900's full-sized avatar

Eric Xu nn1900

  • China
  • 09:39 (UTC +08:00)
View GitHub Profile
@d2s
d2s / installing-node-with-nvm.md
Last active April 24, 2025 18:50
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
import android.annotation.TargetApi;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
import android.os.Build;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.File;
@johnnyman727
johnnyman727 / openwrt-sdk-osx-compile.md
Last active June 16, 2019 19:29
Steps for compiling the OpenWRT SDK on OSX
  1. Install dependencies: brew install sdl openssl gettext
  2. Add the bin folder of gettext to your path: export PATH=$PATH:/usr/local/Cellar/gettext/0.19.4/bin
  3. Go through steps 1-9 here
  4. git clone --recursive https://github.com/tessel/openwrt-tessel.git
  5. cd openwrt-tessel
  6. Replace openwrt/tools/mkimage/Makefile with the file included in this Gist of the similar name (an artifact of OSX being unable to link against SSL development headers). Make sure to change lines 35 and 36 with a valid link to the openssl library brew installed in the previous step, if necessary. I created it by combining this debugging suggestion which didn't work and this updated file on master which also didn't work on its own.
  7. make V=99
/Applications/Xcode.app/Contents/
@clemlatz
clemlatz / self-signed-ssl-certificate.md
Last active January 3, 2025 23:24
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
@BretFisher
BretFisher / pcat-install.sh
Last active April 15, 2025 04:14
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
# first install pygmentize to the mac OS X or macOS system with the built-in python
sudo easy_install Pygments
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc.
alias pcat='pygmentize -f terminal256 -O style=native -g'
@afuggini
afuggini / defineProperty.js
Last active October 29, 2021 17:29
Object.defineProperty polyfill
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
@KaneCheshire
KaneCheshire / SimEnv_Xcode11.json
Created September 26, 2019 07:44
Output for the environment variables available on iOS simulators using `ProcessInfo.processInfo.environment`
{
"CA_ASSERT_MAIN_THREAD_TRANSACTIONS": "0",
"CA_DEBUG_TRANSACTIONS": "0",
"CFFIXED_USER_HOME": "/Users/kanecheshire/Library/Developer/XCTestDevices/2F7BBCEE-1020-4C33-9740-DCB7640911A4/data/Containers/Data/Application/4F2F5AA6-B639-45DE-9851-904569336CC4",
"CUPS_SERVER": "/private/tmp/com.apple.launchd.rz10bWAeQ8/Listeners",
"DYLD_FALLBACK_FRAMEWORK_PATH": ":",
"DYLD_FALLBACK_LIBRARY_PATH": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib",
"DYLD_FRAMEWORK_PATH": "/Users/kanecheshire/Library/Developer/Xcode/DerivedData/Retryable-fezwrtdwmzupungrxeqznlnohxjl/Build/Products/Debug-iphonesimulator:/Users/kanecheshire/Library/Developer/Xcode/DerivedData/Retryable-fezwrtdwmzupungrxeqznlnohxjl/Build/Products/Debug-iphonesimulator",
"DYLD_LIBRARY_PATH": "/Users/kanecheshire/Library/Developer/Xcode/DerivedData/Retryable-fezwrtdwmzupungrxeqznlnohxjl/Build/Products/Debug-iphones