Skip to content

Instantly share code, notes, and snippets.

View bluenex's full-sized avatar
🧐
Be explicit with the least redundant.

Tulakan Ruangrong bluenex

🧐
Be explicit with the least redundant.
View GitHub Profile
@bluenex
bluenex / AtomSnippets.md
Last active December 10, 2015 02:47
Collection of snippets in Atom

All snippets are placed in snippets.cson, you can find it from Atom > Open Your Snippets.

LaTeX

'.text.tex.latex':
  'bold text':
    'prefix': 'b'
    'body': '\\\\textbf{$1}'
  'italic text':
    'prefix': 'i'
@bluenex
bluenex / vim_note.md
Created September 27, 2015 17:33
Vim with spf13 cheat sheet

VIM NOTE

Vim with spf13 cheat sheet

Keys description
i insert before the cursor
I insert at start of line
a insert after the cursor
A insert at start of line
o insert line below
@bluenex
bluenex / zsh_envi.md
Last active May 17, 2023 19:31
Moving to Zsh note and configuration settings.

Moving to Zsh

Have a good time with bash for a long while, it's time to try another tempting shell - Zsh. So, this Gist is nothing but my collection for the environment that I've searched and applied to my system. There is also this kind of Gist in a version of bash.

Why Zsh?

There are several shells out there but this is the one that is close to the bash with some useful and attractive features especially - yes, theme. Here are some good articles about how and why to choose Zsh over bash, enjoy trying!

@bluenex
bluenex / rand_bash.md
Last active September 13, 2015 16:44
Random bash commands that are useful (for me)

VS Code

Calling Visual Studio Code from command line. source

# VS Code 
## old version
code() {
    if [[ $# = 0 ]];
    then
 echo $PWD
@bluenex
bluenex / latex_mtheme.md
Created September 2, 2015 18:22
The preparation in order to get mtheme works on my system.

Introduction

I'm now trying to move from MS Powerpoint to LaTeX Beamer, and thus I've found a theme on Github called mtheme (Metropolis package). It's somehow hard to use at first so that I write this Gist to remind myself when next time installation comes. The system for this setup is Mac OSX 10.10.5 with BasicTeX 2015.

Dependencies

@bluenex
bluenex / bash_envi.md
Last active May 16, 2018 06:18
My bash environment settings on Mac OSX including .bash_profile, .tmux.conf and .vimrc

Installation

brew install tmux
brew install reattach-to-user-namespace  # to make tmux's copy to clipboard possible
brew install vim  # upgrade vim to 7.4 to make copy to clipboard available

# git_hipster
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
curl -OL http://github.com/git/git/raw/master/contrib/completion/git-completion.bash
mv ~/git-completion.bash ~/.git-completion.bash
@bluenex
bluenex / arduino_example.md
Last active August 29, 2015 14:24
Arduino example code from Peach.
#define PIN_LED 13

char buffer;
int time_delay = 1000;

void setup()
{
    Serial.begin(115200);
    pinMode(PIN_LED, OUTPUT);
@bluenex
bluenex / sharpduino_snippet.cs
Last active August 29, 2015 14:23
Snippet to use Sharpduino to control dcmotor
using Sharpduino;
using Sharpduino.Constants;
static void Main(string[] args)
{
// Arduino controlling
int PWMvalue = 1;
var arduino = new ArduinoUno("COM21");
while (!arduino.IsInitialized) ;
@bluenex
bluenex / unity3d_thread_snippet.md
Last active September 2, 2015 18:37
Snippet to allow using thread in Unity3d. This snippet including dependency, where should threading code be, and editor events detection to kill thread.

Dependencies

using System.Threading;
using UnityEditor;

Declare classes

Above the public class ScriptFileName : MonoBehaviour.

public enum PlayModeState

youtube-dl add-on

This add-on is to:

  • bypass certification checking for youtude-dl (2015.04.26) on OSX (10.10.3)
  • pass through proxy (MU proxy)
  • download the best quality of audio or video
  • save to ~/Music/youtube-dl

note Since the latest update of youtube-dl (2015.08.23) and OSX (10.10.4), there is no need to bypass certificate anymore. The proxy also seems to be fixed (by importing system proxy.. maybe). However, the options will remain until I'm sure to take them out later.

requirements