Skip to content

Instantly share code, notes, and snippets.

View katopz's full-sized avatar
🦀
Rust me if you can

Todsaporn Banjerdkit katopz

🦀
Rust me if you can
View GitHub Profile
@katopz
katopz / npm-debug.log
Created January 27, 2016 04:50
npm Maximum call stack size exceeded
This file has been truncated, but you can view the full file.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\katopz\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'http://github.com/bessdsv/bower-installer.git' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
@katopz
katopz / crazy_timezone.swift
Created January 18, 2016 16:30
Crazy Timezone
import Foundation
// 2016 eh?
var dateString = "Fri Jan 01 00:00:00 +1100 2016"
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "E MMM dd HH:mm:ss Z yyyy"
let calendar = NSCalendar.currentCalendar()
let components = calendar.components([.Day , .Month , .Year], fromDate: dateFormatter.dateFromString(dateString)!)
@katopz
katopz / MiniServer2.cs
Created December 23, 2015 07:30
POC : HttpListener
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Diagnostics;
@katopz
katopz / MiniServer.cs
Last active December 23, 2015 07:30
POC C# TCP capture for .NET 4.0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Diagnostics;
Shader "Transparent/Cutout/DiffuseBack" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
Cull front
@katopz
katopz / cleanz.sh
Last active September 22, 2015 14:59
Clean Mac junk file in zip
zip -d foo.zip __MACOSX/\*
zip -d foo.zip \*/.DS_Store
@katopz
katopz / hello-mongodb.js
Created September 10, 2015 11:58
Hello world MongoDB via Meteor + Aggregate
// ref : https://github.com/meteorhacks/meteor-aggregate
Meteor.startup(function () {
// C : insert
console.log("## insert");
// insert list
var list_id = Lists.insert({
name: "foo",
incompleteCount: 1,
Meteor.methods({
getFirebaseToken: function (userId) {
if (!userId) {
throw new Meteor.Error("not-logged-in",
"Must be logged in to enter chat.");
}
var FirebaseTokenGenerator = Meteor.npmRequire("firebase-token-generator");
var tokenGenerator = new FirebaseTokenGenerator(YOUR_FIREBASE_SECRET);
@katopz
katopz / firebase_authen.js
Last active September 7, 2015 05:45
Async call to authen Firebase via Meteor
// https://github.com/firebase/firebase-token-generator-node
Meteor.methods({
enterChat: function (userId) {
if (!userId) {
throw new Meteor.Error("not-logged-in",
"Must be logged in to enter chat.");
}
@katopz
katopz / firebase_bridge.js
Last active August 27, 2015 16:14
firebase_bridge.js for medium
var Firebase = Meteor.npmRequire("firebase");
var firebase = new Firebase('https://radiant-inferno-foo.firebaseio.com/');
firebase.on('child_added', willLog);
firebase.on('child_changed', willLog);
firebase.on('child_removed', willLog);
function willLog(snapshot) {
console.log(snapshot.key() + " : " + EJSON.stringify(snapshot.val()));
}