Skip to content

Instantly share code, notes, and snippets.

View askdaddy's full-sized avatar

Seven Chan askdaddy

  • Internet
View GitHub Profile
@askdaddy
askdaddy / clean_boot.md
Last active March 16, 2020 09:08
清理/boot目录
@surma
surma / README.md
Last active March 8, 2024 12:06
webpack-emscripten-wasm

Minimal example making webpack and wasm/Emscripten work together.

Build instructions:

  • Clone this gist
  • npm install
  • npm start
  • Open http://localhost:8080
  • Look at console
@bigtan
bigtan / compile.sh
Last active November 10, 2023 15:31
shadowsocks-libev static build
apt-get update && apt-get install build-essential automake autoconf libtool git clang -y && export CC=clang
ver=2.16.3
wget --no-check-certificate https://tls.mbed.org/download/mbedtls-$ver-gpl.tgz
tar zxf mbedtls-$ver-gpl.tgz
cd mbedtls-$ver
sed -i "s/DESTDIR=\/usr\/local/DESTDIR=\/projects\/dists\/mbedtls/g" Makefile
LDFLAGS=-static WINDOWS_BUILD=1 make -j`nproc` install
cd ..
@aschrijver
aschrijver / RNNodeService.java
Last active May 3, 2018 03:59
RNNodeService using ScheduledExecutorService to cancel long-running NodeJS tasks (express webserver) - NOT Working
package world.fullcircle.nodeonandroid;
import android.app.Service;
import android.content.Intent;
import android.content.res.AssetManager;
import android.os.IBinder;
import android.util.Log;
import com.eclipsesource.v8.NodeJS;
import com.eclipsesource.v8.V8;
@mtvee
mtvee / main.cpp
Last active September 19, 2023 07:22
cross platform socket example c/c++
#include<cstdio>
#include<cstring>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include<unistd.h>
@harv
harv / cross_and_static_compile_shadowsocks-libev.sh
Last active February 18, 2024 12:05
cross & static compile shadowsocks-libev
#!/bin/sh
# cross & static compile shadowsocks-libev
PCRE_VER=8.41
PCRE_FILE="http://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$PCRE_VER.tar.gz"
MBEDTLS_VER=2.6.0
MBEDTLS_FILE="https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz"
@ndelangen
ndelangen / simple-fork-example.js
Created January 2, 2017 14:20
Fork can spawn a new NodeJS process. You give it a javascript file to execute.
const fork = require('child_process').fork;
const program = path.resolve('other.js');
const child = fork(program);
@Manu343726
Manu343726 / CMakeLists.txt
Created October 26, 2016 14:02
Configure protobuf with cmake
cmake_minimum_required(VERSION 3.4)
project(MyProject)
if(NOT MY_PROJECT_PROTOBUF_VERSION)
set(MY_PROJECT_PROTOBUF_VERSION 2.6.1)
endif()
option(MY_PROJECT_SHARED_LIBS "Build proto modules as shared libraries" OFF)
message(STATUS "Google Protocol Buffers version: ${MY_PROJECT_PROTOBUF_VERSION}")
@TobleMiner
TobleMiner / blaze
Last active December 28, 2016 06:26
dn42 OSPF setup: Lockdown is the peering vm, blaze is the primary router and connects to lockdown via interface dn42. 'some random dn42 enabled vm' is connected to blaze via interface dn42-gw.
protocol ospf dn42
{
table vm;
instance id 1;
export all;
import all;
area 0
{
interface "dn42"
{
@turtlemonvh
turtlemonvh / README.md
Created August 8, 2016 18:27
Example vagrant file

Example vagrantfile

With ssh config adding, data directory mounted, provision script setup. 2 CPUs and 4 GB of RAM.

Create a setup bash script at provision/setup.sh and it will be run.