Skip to content

Instantly share code, notes, and snippets.

Chih-Hsuan Yen yan12125

Block or report user

Report or block yan12125

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active Jun 3, 2020
Hyperlinks in Terminal Emulators
View Hyperlinks_in_Terminal_Emulators.md
@valorin
valorin / mosh-allow-ufw.sh
Created Dec 6, 2014
Script to open and close Mosh ports in UFW
View mosh-allow-ufw.sh
#!/bin/bash
# Load active ports
PORTS=`lsof -i | grep mosh-serv | cut -f2 -d":"`
STATUS=`sudo ufw status`
# Add Rules for new ports
for PORT in $PORTS; do
echo $STATUS | grep "$PORT/udp" > /dev/null
@winterz
winterz / setup-travis.sh
Last active May 25, 2017
travis CI setup script
View setup-travis.sh
#/bin/sh -f
# things to do for travis-ci in the before_install section
if ( test "`uname -s`" = "Darwin" )
then
#cmake v2.8.12 is installed on the Mac workers now
#brew update
#brew install cmake
echo
@caasi
caasi / vlc.sh
Created Mar 20, 2014
vlc 2.2.0 and YouTube Live
View vlc.sh
cvlc v4l2:///dev/video0:width=640:height=480 --sout '#transcode{vcodec=h2
64,vb=1000,acodec=aac,ab=64,channels=2}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://a.rtmp.youtube.com/live2
/<key>}'
@XVilka
XVilka / TrueColour.md
Last active Jun 3, 2020
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@branneman
branneman / better-nodejs-require-paths.md
Last active Jun 4, 2020
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@burke
burke / remotepaste.md
Last active Feb 13, 2020
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy
View remotepaste.md

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@pierremarc
pierremarc / test_cc.py
Created Sep 19, 2012
Add files to a repo with pygit2
View test_cc.py
"""
test commit creation with pygit2
To see the result:
rm -rf foo && python test_cc.py && cd foo/ && git log --graph --oneline --date-order --decorate --color --all && git status && cd ..
"""
import os
import sys
import pygit2
@netj
netj / memusg
Last active May 31, 2020
memusg -- Measure memory usage of processes
View memusg
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
You can’t perform that action at this time.