Skip to content

Instantly share code, notes, and snippets.

View nodtem66's full-sized avatar
😀

Jirawat Iamsamang nodtem66

😀
View GitHub Profile
@nodtem66
nodtem66 / ExteenBloglist.js
Last active October 5, 2015 06:08
Javascript to get list of all articles in Exteen
var list = document.getElementById('entrylist') , data=[];
if(list.children[0] && list.children[0].children[0] && list.children[0].children[0].children[1])
list = list.children[0].children[0].children[1].children;
for(i=0, len=list.length; i<len; i++) {
var date = list[i].children[1].innerHTML.split('.').join('/')
,title = list[i].children[2].innerHTML
,directory = list[i].children[3].innerHTML
,category = list[i].children[4].innerHTML
<?xml version="1.0" encoding="UTF-8" ?>
<gdipp>
<version>0.9.1</version>
<gdimm>
<process name="(eclipse|notepad.+)\.exe">
<freetype>
<cache_max_faces>32</cache_max_faces>
<cache_max_sizes>32</cache_max_sizes>
<cache_max_bytes>4194304</cache_max_bytes>
# CTags based autocompletion plugin for Sublime Text 2
# You can add the file to the User Package in ~/Library/Application Support/Sublime Text 2/Packages and restart Sublime Text 2.
# generate the .tags file in your project root with "ctags -R -f .tags"
# Author nodtem66
# fork from: https://gist.github.com/BlackMac/1825401
import sublime, sublime_plugin, os
class AutocompleteAll(sublime_plugin.EventListener):
@nodtem66
nodtem66 / encode_detector.py
Created April 15, 2014 19:44
Encoding Detector in Python
from chardet.universaldetector import UniversalDetector
import os, sys
pwd = os.getcwd()
files = []
if len(sys.argv) == 1:
for (dirpath, dirname, filenames) in os.walk(pwd):
files.extend(filenames)
break
else:
@nodtem66
nodtem66 / rbnb
Created October 13, 2014 07:52
Dataturbine RBNB startup service (/etc/init.d/rbnb)
#!/bin/sh
### BEGIN INIT INFO
# Provides: rbnb
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the dataturbine rbnb server
# Description: starts rbnb using start-stop-daemon
@nodtem66
nodtem66 / ADC_from_Arduino.m
Last active October 3, 2015 17:47
ADC Serial print raw 16 bit binary. for MATLAB processing
clc; close all; clear;
LIMIT = 500;
N_CHANNEL = 6;
% clear opened usb port
if ~isempty(instrfind)
fclose(instrfind);
delete(instrfind);
end
@nodtem66
nodtem66 / owsilprog-flash.py
Last active February 8, 2017 12:50
python CLI for flash silabs MCU with owSilProg firmware
import sys
import time
import os
import serial
import argparse
import math
flasher = None
file = None
isPython2 = sys.hexversion < 0x3000000
## ---------------------- Function 0---------------------------------------------------------------------
@nodtem66
nodtem66 / makefile
Created February 12, 2015 10:23
Simple Makefile
CC=gcc
LDFLAGS=-lusb-1.0
CFLAGS=-c -Wall
SRC=test_iso.c
OBJ=$(SRC:.c=.o)
EXEC=iso
.PHONY: all clean
.SECONDARY: main-build
@nodtem66
nodtem66 / .bashrc
Last active August 29, 2015 14:15
coloring in bashrc
#!/bin/bash
alias grep='grep --color=auto'
alias ls='ls --color=auto'
PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) \[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
@nodtem66
nodtem66 / Patch Sandisk SD Card in ArchLinux for RPi.md
Last active August 29, 2015 14:18
Raspberry Pi with Sandisk 16GB Class 10 and ArchLinux-2014-06-img

Patch Sandisk SD Card in ArchLinux for RPi.md

Due to the raspberrypi/linux#issue414, The patch now finally released. This method work for me:

  1. Use ArchLinuxARM-2014.06-rpi.img.zip and Write it to Sandisk 16GB Class 10 Ultra with Win32DiskImager
  2. Copy the boot-image from my latest kernel from Kington 8GB Class 4 to overwrite the old boot-image in arch-2014-06-22