Skip to content

Instantly share code, notes, and snippets.

View nutzhub's full-sized avatar
🎯
Focusing

Pradit Rattanapongchinda nutzhub

🎯
Focusing
  • Omise
  • Bangkok Thailand
View GitHub Profile
for my $method (qw(build_date bought_date)) {
Sub::Install::install($_ => sub {
my ($self, $input_arg) = @_;
return format_string($self->$method);
});
}
sub apejens {}
@nutzhub
nutzhub / angularjs.html
Last active December 21, 2015 18:48
Show differentiate between service, factory, provider
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="MyCtrl">
{{serviceOutput}}
<br/><br/>
@nutzhub
nutzhub / server.js
Last active December 21, 2015 19:09 — forked from jeffrafter/server.js
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@nutzhub
nutzhub / .jshintrc
Created December 25, 2013 05:36 — forked from taxilian/.jshintrc
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : true,
@nutzhub
nutzhub / .jshintrc
Created December 25, 2013 06:29 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@nutzhub
nutzhub / package.json
Created June 16, 2014 03:19
Builder config in package.json
{
"name": "meetv-chat-server",
"version": "1.0.1",
"description": "Server backend for the MeeTV Chat app",
"scripts": {
"start": "node --debug script/server.js",
"test" : "prove --exec './node_modules/buster/bin/buster-test --reporter tap -t' test -v"
},
"dependencies": {
"express" : "3.x",
use strict;
use warnings;
use Test::More;
use Test::WWW::Mechanize::Catalyst;
use FindBin;
use Mojo::DOM;
use lib "$FindBin::Bin/lib";
use TestSetup;
our $db;
server {
listen 80;
server_name chat.dev.abctech-thailand.com ~.+\.chat\.dev\.abctech-thailand\.com$ ~.+\.chat\.int\.abctech-thailand\.com$ chat.abct.io;
location / {
proxy_pass http://meetv:8080/;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@nutzhub
nutzhub / nginx.conf
Last active August 29, 2015 14:26 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}