Skip to content

Instantly share code, notes, and snippets.

View blmarket's full-sized avatar

Jeong, Heon blmarket

  • Undisclosed company name
  • Vancouver BC, Canada
View GitHub Profile
@blmarket
blmarket / upload.js
Created June 30, 2012 13:06
Upload somewhat big file using nodejs http.client
var http = require('http');
var fs = require('fs');
var filename = process.argv[process.argv.length-1];
var filesize = fs.statSync(filename).size;
var boundary = "----FuckingBoundary12341234"
var options = {
host: '192.168.0.3',
port: '8080',
@blmarket
blmarket / app.js
Created July 23, 2012 01:30
Test 4 cluster with expressjs
var app = require('express').createServer();
var fs = require('fs');
app.get('/', function(req, res, next) {
console.log(process.pid);
res.send("Hi");
});
var stream = fs.createWriteStream("logfile", { flags: 'a' });
function logandlog() {
@blmarket
blmarket / addone.js
Created July 27, 2012 01:31
Naver baseball scraper
var request = require('request');
var url = 'http://localhost:3279/add';
request({
method: 'POST',
url: url,
form: {
category: 'kbo',
id: '28178',
@blmarket
blmarket / iPadPreset.js
Created August 7, 2012 15:05
Transcode to iPad
exports.load = function(ffmpeg) {
ffmpeg
.toFormat('m4v')
.withVideoBitrate('1200k')
.withVideoCodec('libx264')
.withSize('1024x768')
.withAudioBitrate('128k')
.withAudioCodec('libvo_aacenc')
.withAudioChannels(2)
.addOptions(['-flags', '+loop+mv4', '-cmp', '+chroma', '-partitions','+parti4x4+partp8x8+partb8x8', '-flags2',
@blmarket
blmarket / csstiles.html
Created August 31, 2012 17:08
css tiles
<html>
<head>
<style type="text/css">
table.tile {
position: relative;
padding: 0;
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
#!/usr/bin/env node
var fs = require('fs');
var dicts = { 4: 'word4.txt', 5: 'word5.txt' };
var destination = process.argv.pop();
var source = process.argv.pop();
if(destination.length != source.length) {
throw new Error("Argument Error : source and destination should be equal length");
#include <memory>
#include <iostream>
using namespace std;
typedef function<void(int)> func;
shared_ptr<func> create_lambda() {
return make_shared<func>([]() {
int tmp;
@blmarket
blmarket / display.html
Last active December 17, 2015 02:49
Commit activity by hours
<!doctype HTML>
<html ng-app>
<head>
<title>result</title>
<meta charset="utf-8"/>
<!--<link rel="stylesheet" href="css/bootstrap.min.css"/>-->
<style type="text/css">
table {
font-size: 6px;
}
@blmarket
blmarket / main.pl
Last active December 19, 2015 19:18
Twitter Image-only Reader.
#!/usr/bin/env perl
use utf8;
use strict;
binmode STDOUT, ':utf8';
use Tk;
use Tk::Photo;
use Tk::PNG;
use Tk::JPEG;
use Tk::After;
@blmarket
blmarket / Gruntfile.coffee
Created July 17, 2013 06:28
one of another Gruntfile example. Gruntfile용 example이 생각보다 많지 않아서 올려둔다. 원래 requirejs도 사용했었으나 필요가 없어져서 다시 빼버림.
module.exports = (grunt) ->
grunt.initConfig {
pkg: grunt.file.readJSON('package.json')
coffee: {
compile: {
options: {
bare: true
}
files: {
'public/dist/plugin.js': 'public/collector/plugin.coffee'