Skip to content

Instantly share code, notes, and snippets.

View hankbao's full-sized avatar
🧠
use it or lose it

Hank Bao hankbao

🧠
use it or lose it
View GitHub Profile
@cloudwu
cloudwu / clog.c
Created February 5, 2024 04:49
concurrence log
#include "clog.h"
#include <stdatomic.h>
#include <stdlib.h>
#include <string.h>
#define LOGMETA_BUFFER 4096
#define LOGDATA_BUFFER (64 * 1024)
// [..........................]
// ^
@lexrus
lexrus / doss.sh
Last active November 28, 2023 12:37
A tiny script to initialize a new Shadowsocks server in DigitalOcean.
#!/bin/bash
#
# This macOS bash script helps you initialize a new Shadowsocks server with doctl in seconds.
# Original author: lexrus https://github.com/lexrus
#
# You can get $100 free credit for create VPS in DigitalOcean with my referral link:
# https://m.do.co/c/3eb5cf371fc9
#
# Please intall and authorize doctl before running this script.
# https://github.com/digitalocean/doctl
@everttrollip
everttrollip / remove-git-lfs.md
Last active March 13, 2024 08:46
Removing git lfs from (any) repository

So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,

  • commit & push everything
  • create a branch, something like fix/remove-lfs
  • remove hooks git lfs uninstall
  • remove lfs stuff from .gitattributes (open file, delete content - don't delete the file!)
  • list all lfs files, git lfs ls-files
  • run git rm --cached for each file
    • if your list is big, copy the contents into a file.txt
  • make sure you remove the number and asterik on each line, you only want the paths to the files
@gdianaty
gdianaty / cmakejs.cmake
Last active February 23, 2024 04:32
CMake.js Inclusion Function for ordinary CMake
# Authored by Graham Dianaty for Bitlogix Technologies. Based on code from Rene Hollander. ==========//
function(setup_cmakejs)
find_program(CMAKEJS "cmake-js")
find_program(NPM "npm")
# first, check if we have NPM:
if(NPM)
message(VERBOSE "NPM found.")
else()
message(FATAL_ERROR "NPM not found. This project requires Node.js")
endif()
@nillsondg
nillsondg / OSX_Dictionary_Lookup.py
Last active January 29, 2024 07:16
Simple addon to quickly lookup words in the OSX dictionary
# coding: utf-8
"""
Simple addon to quickly lookup words in the OSX dictionary
Author: Dmitry Gordeev <nillsondg@gmail.com>
Heavily based of work by
Eddie Blundell <eblundell@gmail.com>
https://gist.github.com/eddie/ff3d820fb267ae26ca0e
Artiom Basenko <demi.log@gmail.com>
@ssokolow
ssokolow / generate_sql_docs.py
Created March 4, 2019 02:12
A one-off script for converting a specific dump of the SDL wiki into a Dash/Zeal docset... in case it's useful to someone
#!/usr/bin/env python
"""Quick script to generate a Dash/Zeal docset from the SDL 2 wiki.
Requirements:
- Python 2.x (3.x may work, but it's untested)
- LXML (for parsing the non-XML HTML used in the pages)
- Pillow (for converting favicon.ico into icon.png)
- http://www.libsdl.org/tmp/SDL-wiki.zip
"""
@Jimmy-Z
Jimmy-Z / services-start.sh
Created February 28, 2019 08:42
multi SSID with VLAN script, for ASUS AC86U with merlin
#!/bin/sh
# multi SSID with VLAN script, for ASUS AC86U with merlin
#
# setup before hand:
# set "router" to "AP Mode"
# this will put all ports and wireless in br0
# create 2 guest network
# enable Administration => System => Enable JFFS custom scripts and configs
# put this script in /jffs/scripts/, name should be "services-start"
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@masklinn
masklinn / cheatsheet.md
Last active May 1, 2024 15:58
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,