Skip to content

Instantly share code, notes, and snippets.

View newmind's full-sized avatar
🎯
Focusing

JG newmind

🎯
Focusing
View GitHub Profile
@newmind
newmind / loader.html
Created March 7, 2018 06:14 — forked from bellbind/loader.html
[threejs][html5]STL File Viewer with HTML5 File API
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>STL File Viewer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"
></script>
<script src="https://rawgit.com/mrdoob/three.js/master/examples/js/controls/TrackballControls.js"
></script>
<script src="loader.js"></script>
@newmind
newmind / backend-architectures.md
Created November 5, 2017 16:27 — forked from ngocphamm/backend-architectures.md
Backend Architectures
@newmind
newmind / ways.py
Created October 30, 2017 10:08 — forked from anonymous/ways.py
def ways(N, Memo):
print 'N', N, Memo
if N < 0: return 0
if N in Memo:
return Memo[N]
else:
Memo[N] = N+1
if N == 1:
Memo[N] += 1
@newmind
newmind / history_navigation.js
Created April 7, 2016 05:21 — forked from tbtlr/history_navigation.js
A simple JavaScript that lets you use your browser's back/forward buttons for in-page navigation by adding custom 'next' and 'previous' events to the window object.
/*
* Lets you use your browser's back/forward buttons for in-page navigation by
* adding custom 'next' and 'previous' events to the window object.
*
* Copyright (c) 2011 Tobias Schneider <schneider@jancona.com>
* This script is freely distributable under the terms of the MIT license.
*
* Example:
*
* window.addEventListener('next', function(){
@newmind
newmind / elb-nodejs-ws.md
Created March 11, 2016 06:20 — forked from obolton/elb-nodejs-ws.md
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

@newmind
newmind / gist:12daa3892074a6b5c886
Created February 13, 2016 00:23 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
<?xml version="1.0" encoding="UTF-8"?>
<tables>
<row>
<cols>
<col name="Metric" href="http://google.com/">Disti Quoting</col>
<col name="Error Count" href="http://naver.com.com/">95</col>
<col name="_IW_COLOR">RED</col>
<col name="_IW_ICON_BLINK">yes</col>
</cols>
</row>
#-*- coding: utf-8 -*-
"""
The SocketServer module does not provide support for multicast. This module
provides a subclass of SocketServer.UDPServer that can listen on multicast
addresses.
This only supports IPv4
"""
#-*- coding: utf-8 -*-
#
# windows 에서 multicast join 상태 보는법
# netsh interface ip show joins
# linux 에서 multicast join 상태 보는법
# netstat -g
import socket
import struct
#-*- coding: utf-8 -*-
import socket
MCAST_GRP = '225.0.0.1'
MCAST_GRP2 = '226.0.0.1'
MCAST_GRP3 = '227.0.0.1'
MCAST_PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)