Skip to content

Instantly share code, notes, and snippets.

View jnbdz's full-sized avatar
👨‍💻
None stop

JN Σ jnbdz

👨‍💻
None stop
View GitHub Profile
var dialClock = function(rotate) {
var dial = document.getElementById('dial-clock'),
ctx = dial.getContext('2d'),
angle,
secHandLength = 360,
bigDegNum = (isInt(rotate) || isFloat(rotate))?rotate:3,
smallDegNum = (isInt(rotate) || isFloat(rotate))?rotate * 5:15;
ctx.clearRect(0, 0, dial.width, dial.height);
@jnbdz
jnbdz / JsScrollBar.js
Last active October 27, 2015 18:55
Vanilla ScrollBar
var isInt = function(n) {
return n % 1 === 0;
},
isFloat = function(n) {
return n === Number(n) && n % 1 !== 0;
};
function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
@jnbdz
jnbdz / gist:4464264
Last active December 10, 2015 16:58
Small script to test webworker postMessage.
self.addEventListener('message', function(e) {
self.postMessage(e.data);
}, false);
@jnbdz
jnbdz / gist:7624654
Created November 24, 2013 08:05
League OAuth2 - DropBox
<?php
namespace League\OAuth2\Client\Provider;
use League\OAuth2\Client\Token\AccessToken;
class DropBox extends IdentityProvider
{
public function urlAuthorize()
$TTL 604800
@ IN SOA one.example.com. admin.one.example.com. (
3 ; Serial
604800 ; Refresh
2419200 ; Retry
604800 ) ; Negative Cache TTL
; name servers
IN NS ns1.one.example.com.
; PTR Records
acl "trusted" {
# 127.0.0.1;
10.8.0/24;
# 10.8.1.0/24;
};
options {
directory "/var/cache/bind";
recursion yes; # enables resursive queries
zone "one.example.com" {
type master;
file "/etc/bind/zones/db.one.example.com"; # zone file path
# allow-transfer { 10.128.20.12; }; # ns2 private IP address - secondary
};
zone "8.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.10.8"; # 10.8.0/24 subnet
# allow-transfer { 10.128.20.12; }; # ns2 private IP address - secondary
$TTL 604800
@ IN SOA ns1.one.example.com. admin.one.example.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
)
;
; name servers - NS records
@jnbdz
jnbdz / db.jn
Created January 13, 2016 23:33
;
; BIND data file for TLD ".jn"
;
$TTL 604800
@ IN SOA jn. root.jn. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@jnbdz
jnbdz / .vimrc
Created January 21, 2016 11:45
.vimrc 2016
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required