Skip to content

Instantly share code, notes, and snippets.

View sebmck's full-sized avatar

Sebastian sebmck

  • 09:11 (UTC -05:00)
View GitHub Profile
function time(){
var time = process.hrtime();
return (time[0] * 1000) + (time[1] / 1000000);
}
var start = time();
var tmp = [];
for (var i = 0; i < 10000; i++){
tmp.push("test");
}
/**
* @file Functions relating to type validation.
*/
module.exports = function(_){
/**
* Check if value is an object, if not return an empty object
*
* @param {Object} obj
╔═════════════════╦════════════╦═════════╦════════════╦════════════╦═════════╗
║ ║ Monday ║ Tuesday ║ Wednesday ║ Thursday ║ Friday ║
╠═════════════════╬════════════╬═════════╬════════════╬════════════╬═════════╣
║ Morning ║ ║ ║ Radio ║ ║ ║
║ (8:25-8:55) ║ ║ ║ ║ ║ ║
╠═════════════════╬════════════╬═════════╬════════════╬════════════╬═════════╣
║ Period 1 ║ Math ║ VCE IT ║ Philosophy ║ Literature ║ English ║
║ (8:55 - 10:10) ║ VA2 ║ 306 ║ ║ ║ 206 ║
╠═════════════════╬════════════╬═════════╬════════════╬════════════╬═════════╣
║ Recess ║ ║ ║ Radio ║ ║ ║
uint64_t uv__hrtime(void) {
mach_timebase_info_data_t info;
if (mach_timebase_info(&info) != KERN_SUCCESS)
abort();
return mach_absolute_time() * info.numer / info.denom;
}
console.group("ahh"); // |- ahh
console.log("what"); // | what
console.log("ahh"); // | ahh
console.group("foo"); // |- foo
console.log("wtf"); // | wtf
console.groupEnd();
console.log("foo"); // | foo
console.groupEnd();
/**
* @file Description
*/
NYX(function(){
$("[data-dynamic-data]").each(function(){
var elem = $(this);
var name = elem.attr("data-dynamic-data");
var id = elem.attr("data-id");
var event = "dynamic-data " + name + " " + id;
/**
* @file Description
*/
/**
* Description
*
* @constructor
*/
module.exports = function(){
this.when('type', 'image', function(){
this.validates('imageSource', {
required: true,
restrict: ['web', 'computer']
});
this.when('imageSource', 'web', function(){
this.validates('imageUrl', {
alias: this.lang('submit#pictureUrl'),
ul.buttons
clear-fix()
font-weight bold
> li
float left
position relative
.icon
position absolute
function check(host, callback){
var dns = require('dns');
var net = require('net');
var blacklist = ['72.51.33.80'];
function resolved(err, ip){
callback(!err && blacklist.indexOf(ip) !== -1);
}