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 / git_command_note.md
Last active April 28, 2021 00:16
Git command note

The latest commit

git commit --amend

The command amend changes the latest commit by replacing with the new one. Suppose you have changes in working directory, by running git commit --amend the new changes will be committed as replacement of the old latest commit. If there is no new changes, this command will let you change commit comment of the latest commit and save as new commit replacing old latest commit.

# undo commit
git reset --soft HEAD~1
# undo add
@bluenex
bluenex / sticky_footer.md
Last active August 29, 2015 14:15
HTML+CSS note
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@bluenex
bluenex / libpng_fix.md
Last active August 9, 2023 14:50
fixing 'libpng warning: iCCP: known incorrect sRGB profile' appears in Pygame.

Libpng warning: iCCP: known incorrect sRGB profile.

Some .png images used in pygame may get the warning read as "libpng warning: iCCP: known incorrect sRGB profile". To solve this I have searched and found the solution by using ImageMagick. After installing, single file can be fixed by calling convert <in_img> -strip <out_img>, but to make it fixes every wanted images in path we'll need to modify just a little bit.

Create .bat file contains the following code and place this .bat in the folder that want to be fixed and run to finish it out.

@echo off
ping -n 2 127.0.0.1 > nul

echo this batch will convert ".png" using -strip option from ImageMagick.
@bluenex
bluenex / mongo_cd_install.md
Last active August 29, 2015 14:16
Some installation for add-on, plugin or apps.

MongoDB C# Driver

To install Official .NET driver for MongoDB, run the following command in the Package Manager Console.

PM> Install-Package mongocsharpdriver -Version 1.10.0

check for the latest version here


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

@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
@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 / 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 / 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