Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Seven askdaddy

🎯
Focusing
View GitHub Profile
@askdaddy
askdaddy / example.lua
Created Jan 29, 2021 — forked from mebens/example.lua
Doubly linked list in Lua
View example.lua
require("list")
local a = { 3 }
local b = { 4 }
local l = list({ 2 }, a, b, { 5 })
l:pop()
l:shift()
l:push({ 6 })
l:unshift({ 7 })
@askdaddy
askdaddy / ssh-copy-github
Created Dec 2, 2019
Import your ssh keys from github
View ssh-copy-github
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ssh-copy-github
===============
@author: sang
Import all your ssh keys from github to `authorized_keys`.
Performs deduplication over public keys.
@askdaddy
askdaddy / svn_to_git.rst
Created Jun 5, 2019 — forked from epicserve/svn_to_git.rst
Convert SVN Repositories to Git Repositories
View svn_to_git.rst

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

@askdaddy
askdaddy / compile.sh
Created Aug 7, 2018 — forked from bigtan/compile.sh
shadowsocks-libev static build
View compile.sh
apt-get update && apt-get install build-essential automake autoconf libtool git clang -y && export CC=clang
ver=2.6.0
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 make install
cd ..
View cross_and_static_compile_shadowsocks-libev.sh
#!/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"
@askdaddy
askdaddy / GitHub curl.sh
Created May 10, 2018 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
View GitHub curl.sh
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
View tmux-cheatsheet.markdown

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@askdaddy
askdaddy / multiple_ssh_setting.md
Created Mar 23, 2018 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@askdaddy
askdaddy / log.js
Created Nov 26, 2017 — forked from vikas5914/log.js
Custom Logger Library with winston
View log.js
var winston = require('winston')
// set default log level.
var logLevel = 'info'
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'blue',