Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Daniel Shih danielhtshih

:octocat:
  • Taipei, Taiwan
View GitHub Profile
View hello.go
package main
import (
"fmt"
"github.com/danielhtshih/libhelloworld-go"
)
func main() {
fmt.Printf("%s", helloworld.Sayhelloworld())
}
View #python and c++ integration
Makefile
hello_ext.cpp
test.py
@danielhtshih
danielhtshih / http_server.js
Last active Aug 29, 2015
#nodejs #javascript
View http_server.js
/* jslint node:true */
//
// Example of http server using node.js
//
// Authored by Daniel Shih <hotingwow@gmail.com>
//
// check the number of arguments
if (process.argv.length !== 3) {
console.log("usage: " + process.argv[0] + " " + process.argv[1] +
@danielhtshih
danielhtshih / keyword_suggest.py
Last active Dec 26, 2015
#python #api #google #suggest
View keyword_suggest.py
#!/usr/bin/python
"""Example to get keyword suggestion via Google Suggest API
Authored by Daniel Shih <hotingwow@gmail.com>
"""
from sgmllib import SGMLParser
import urllib2
import urllib
View mysql_client.py
#!/usr/bin/python
"""Example to connect to MySQL database using MySQL-python
Authored by Daniel Shih <hotingwow@gmail.com>
"""
import MySQLdb
from sys import argv
@danielhtshih
danielhtshih / signal_handlers.cpp
Last active Dec 25, 2015
#signal #cpp #linux
View signal_handlers.cpp
//
// Example of linux signal handlers
//
// Authored by Daniel Shih <hotingwow@gmail.com>
//
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@danielhtshih
danielhtshih / mq_get.py
Last active Dec 24, 2015
#mq #python #mqget #pymqi
View mq_get.py
#!/usr/bin/python
"""Example of WebSphere MQ client (get message) using PyMQI
for ubuntu, export LD_LIBRARY_PATH=/opt/mqm/lib64 before running the script
Authored by Daniel Shih <hotingwow@gmail.com>
"""
import pymqi
import CMQC
@danielhtshih
danielhtshih / mq_put.py
Last active Dec 24, 2015
#mq #python #mqput #pymqi
View mq_put.py
#!/usr/bin/python
"""Example of WebSphere MQ client (put message) using PyMQI
for ubuntu, export LD_LIBRARY_PATH=/opt/mqm/lib64 before running the script
Authored by Daniel Shih <hotingwow@gmail.com>
"""
import pymqi
from sys import argv
@danielhtshih
danielhtshih / mqtt_subscriber.py
Last active Mar 23, 2017
#mqtt #python #subscribe #mosquitto
View mqtt_subscriber.py
#!/usr/bin/python
"""Example of MQTT client (subscriber) using Mosquitto
Authored by Daniel Shih <hotingwow@gmail.com>
"""
from mosquitto import Mosquitto
from sys import argv
from socket import gethostname
@danielhtshih
danielhtshih / mqtt_publisher.py
Last active Dec 24, 2015
#mqtt #python #publish #mosquitto
View mqtt_publisher.py
#!/usr/bin/python
"""Example of MQTT client (publisher) using Mosquitto
Authored by Daniel Shih <hotingwow@gmail.com>
"""
from mosquitto import Mosquitto
from sys import argv
from socket import gethostname
You can’t perform that action at this time.