Skip to content

Instantly share code, notes, and snippets.

View fishkingsin's full-sized avatar
✈️

James Kong fishkingsin

✈️
View GitHub Profile
@fishkingsin
fishkingsin / html_mobile_template.html
Created March 17, 2014 03:46
html template for mobile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mobile Template</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="meta/apple-touch-icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="HandheldFriendly" content="True">
@fishkingsin
fishkingsin / gst_test_server.sh
Last active August 29, 2015 14:01
gst eample video server
gst-launch-1.0 videotestsrc horizontal-speed=5 ! x264enc tune="zerolatency" threads=1 ! rtph264pay config-interval=1 ! tcpserversink port=8554
gst-launch-1.0 tcpclientsrc port=8554 host=localhost ! tsdemux ! h264parse ! avdec_h264 ! autovideosink
@fishkingsin
fishkingsin / ofApp.cpp
Created May 18, 2014 11:08
openframeworks + ofxGstreamer + ARDrone Video Stream
#include "ofApp.h"
#include "ofGstVideoPlayer.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofGstVideoPlayer* gstPlayer = new ofGstVideoPlayer();
player.setPlayer(ofPtr<ofGstVideoPlayer>(gstPlayer));
ofGstVideoUtils *gstUtil = gstPlayer->getGstVideoUtils();
gstUtil->setPipeline("tcpclientsrc host=192.168.1.1 port=5555 ! h264parse ! decodebin ! videoconvert ! videoscale",24,true,640,360);
gstUtil->startPipeline();
@fishkingsin
fishkingsin / bluez_script.sh
Last active August 29, 2015 14:02
ble adv uuid
sudo hciconfig hci0 up
sudo hciconfig hci0 leadv
sudo hciconfig hci0 noscan
hciconfig
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 00 00 00 00 C8 00
hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 00 00 00 00 C8 00
E20A39F4-73F5-4BC4-A12F-17D1AD07A961
f963ee85-2897-5d5d-8c09-a731f11066c5
@fishkingsin
fishkingsin / TakePhotoSendGamil.py
Created June 8, 2014 17:44
TakePhotoSendGamil
#!/usr/bin/env python
import smtplib
import picamera
import time
import datetime
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE, formatdate
from email import Encoders
@fishkingsin
fishkingsin / sendTracks.mm
Created June 19, 2014 03:52
the removed routin about save json and send zip
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSString *url = [NSString stringWithFormat:@"%@%@%@",kAPIScheme, kBaseURL, USER_TRACKING_DATA];
[manager POST:url parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
ZipArchive *zip1 = [[ZipArchive alloc] init];
BOOL ret = [zip1 CreateZipFile2:[documentsDirectory stringByAppendingPathComponent:@"data.zip"]];
//convert plist to JSON
NSError *error = nil;
NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:jsonPath append:NO];
@fishkingsin
fishkingsin / ofApp.cpp
Created July 9, 2014 03:13
videoTunnel
#pragma once
#include "ofMain.h"
#define NUM_TEXTURE 100
#include "ofxUI.h"
#include "ofxDuration.h"
//#define USE_SYPHON
#ifdef USE_SYPHON
#include "ofxSyphon.h"
#endif
//Universal function which sets normals for the triangle mesh
void setNormals( ofMesh &mesh ){
//The number of the vertices
int nV = mesh.getNumVertices();
//The number of the triangles
int nT = mesh.getNumIndices() / 3;
vector<ofPoint> norm( nV ); //Array for the normals
//Scan all the triangles. For each triangle add its
//normal to norm's vectors of triangle's vertices
for (int t=0; t<nT; t++) {
CC= /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk