This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (global) { | |
| "use strict"; | |
| global._if = function () { | |
| var args = arguments; | |
| if (args.length == 3) { | |
| (args[0] ? args[1] : args[2])(); | |
| } else if (args.length == 4) { | |
| args[0] ? setTimeout(args[1], args[3]) : setTimeout(args[2], args[3]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://www.brynosaurus.com/pub/net/p2pnat/ | |
| https://tools.ietf.org/html/rfc5128 | |
| https://en.wikipedia.org/wiki/Rendezvous_protocol | |
| https://en.wikipedia.org/wiki/UDP_hole_punching | |
| https://github.com/samyk/pwnat | |
| http://superuser.com/questions/885140/how-to-use-udp-hole-punching-for-a-ssh-tunnel-session | |
| http://stackoverflow.com/questions/8993781/torrent-peer-to-peer-connection | |
| https://github.com/jankolkmeier/node-upd-hole-punching | |
| http://quicksorted.com/how-bit-torrent-and-skype-work-behind-a-nat-router/?so | |
| https://www.quora.com/How-does-BitTorrent-deal-with-people-behind-NAT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DNS | |
| | A @ 188.226.235.57 | CNAME * singlepage.ninja. | |
| # nginx | |
| server_name *.singlepage.ninja; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("DOMContentLoaded", init, false); | |
| // | |
| var count = 0; | |
| // | |
| var circle_r = 20; | |
| var circle_w = 25; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @module do.cpp | |
| * @author eray arslan | |
| * @date 06.2015 | |
| * | |
| * dylib : g++ -dynamiclib -o do.dylib do.cpp | |
| * so : g++ -bundle -o do.so do.cpp | |
| * | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var PORT = 8001; | |
| var HOST = "localhost"; | |
| var net = require('net'); | |
| var client = net.connect(PORT, HOST); | |
| var q = []; // queue | |
| var counter = 0; | |
| var firstDroped = false; | |
| var reconnector = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Client = function (port, host, next) { | |
| this._counter = 0; | |
| this._reply = {}; | |
| this._chunk = ""; | |
| this._d_index = -1; | |
| this._interval = 5000; | |
| this._firstDrop = false; | |
| this._port = port; | |
| this._host = host; | |
| this._reconnector = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var filters = { | |
| "grey": function (color, i) { | |
| var opt = (color.r + color.g + color.b) / 5; | |
| pix[i+0] = opt; | |
| pix[i+1] = opt; | |
| pix[i+2] = opt; | |
| }, | |
| "black": function (color, i) { | |
| var opt = (color.r + color.g + color.b) / 3; | |
| if (opt > 255 / 5) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>golden ratio</title> | |
| </head> | |
| <body> | |
| <div id="point"></div> | |
| <script> | |
| var go = 1; | |
| var timeout = 100; // ms | |
| var el = document.getElementById("point"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user] | |
| name = Eray Arslan | |
| email = blablabla | |
| [alias] | |
| pr = pull --rebase | |
| co = checkout | |
| st = status | |
| ec = config --global -e | |
| br = branch -vv | |
| gr = grep -i |