Skip to content

Instantly share code, notes, and snippets.

Avatar

Stanley Zheng stanzheng

View GitHub Profile
View node_hot_reload.js
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
@stanzheng
stanzheng / cloudSettings
Last active May 25, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-11-15T22:05:25.530Z","extensionVersion":"v3.4.3"}
@agatsoh
agatsoh / python3.7.3_on_MX_Linux_18_1.md
Last active Sep 8, 2020
Install python 3.7 on MX Linux 18.1
View python3.7.3_on_MX_Linux_18_1.md

Installing Python 3.7.3 on MX-linux 18.1

I was following this blog to install python 3.7.3 on my MX-linux 18.1 machine. Step by step procedure is as follows

  1. Install the pre-requisites

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
    libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
@ddevault
ddevault / Makefile
Last active Jun 17, 2021
Tiny Wayland compositor
View Makefile
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
View magic.js
class Magic {
constructor(fn, a) {
this.__chain = [[fn, a]];
}
get(t, a) {
if (a == "✨✨MAGIC✨✨") return true;
if (a == "resolve") {
return () => Magic.chain(this.__chain);
}
return (...b) => {
@sursh
sursh / README.md
Last active Sep 27, 2017
Introducing RC Connections
View README.md

RC Connections is a way of connecting with others in the Recurse Center community.

Rooted in the belief that everyone has experience and skills that are valuable to someone else, we have no separate list for mentors and mentees. We are all mentors. We are all mentees. For example, Sasha and Andrew had a phone chat recently where she helped him structure a talk he was working on and he told her about the master’s program he recently finished, as she’s considering doing one herself.

If you know a specific person in RC that you'd like to talk with, then you should probably reach out to them directly! RC Connections is meant to facilitate discussion when it's not obvious that a potential connection should happen.

This service is organized by alumni (currently, Sasha and Andrew). Furthermore, RC Connections is an experiment. We welcome and encourage feedback. Please use the #connections Zulip stream to discuss.

How it works:

  • We’ll start on a ~monthly rhythm
@mosquito
mosquito / README.md
Last active Jul 7, 2021
Add doker-compose as a systemd unit
View README.md

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@hoesler
hoesler / install_jenkins_plugin.sh
Last active Oct 22, 2020 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
View install_jenkins_plugin.sh
#!/usr/bin/env bash
set -e
set -o pipefail
plugin_repo_url="http://updates.jenkins-ci.org/download/plugins"
plugin_dir="/var/lib/jenkins/plugins"
include_optionals=false
showUsage() {
View streams.scm
;; dispatcher is a work in progress haha
(define-syntax dispatcher
(lambda (x)
(syntax-case x (else)
((d name (case1 do1 ...) ... )
(with-syntax ( (args (datum->syntax #'d 'args)) )
#'(define (name m . args)
(case m
(case1 do1 ...) ...
(else (error (symbol->string 'name) "bad operation" m)))))))))