Skip to content

Instantly share code, notes, and snippets.

View dynajoe's full-sized avatar

Joe Andaverde dynajoe

  • Temporal Technologies
  • United States
View GitHub Profile
@dynajoe
dynajoe / io.cs
Last active December 16, 2015 20:29
File IO in C#
var contents = File.ReadAllText("file.txt");
@dynajoe
dynajoe / io.rb
Created May 1, 2013 01:50
File IO in ruby
contents = File.read "file.txt"
$contents = file_get_contents("file.txt");
fs.readFile('file.txt', function (err, contents) {
//do something useful with contents
});
@dynajoe
dynajoe / mismatch.js
Last active December 20, 2015 12:59
detect name or birth mismatch
var http = require('http');
var modelNames = {'RadExam': 4, 'PathExam': 1, 'LabResult': 8/*, 'Patient': 1*/ };
// var modelNames = {'RadExam': 2, 'PathExam': 2, 'LabResult': 2, 'Patient': 1 };
// var rootUrl = 'illum-qa-india.softek.local:8080/solr/';
var rootUrl = 'illum-index-prod:8080/solr/';
var modelNames = {'RadExam': 4, 'PathExam': 1, 'LabResult': 8, 'Patient': 1 };
@dynajoe
dynajoe / extended.js
Last active August 29, 2015 14:01
Extending Objects
var EventEmitter = require('events').EventEmitter;
var MyNewEmitter = function () {
EventEmitter.call(this);
var that = this;
setInterval(function () {
that.emit('myEvent');
}, 1000);
};
@dynajoe
dynajoe / talk-proposals.md
Created August 31, 2014 03:19
Talk Proposals

JavaScript in detail

This talk is geared toward developers with a basic to intermediate understanding of JavaScript. It will be a whirlwind tour of the most commonly misunderstood concepts of JavaScript including closures, variable hoisting, the this keyword, and prototypal inheritance. You'll leave this talk with a more thorough understanding of JavaScript and be well prepared to write applications that take advantage of the great power of expression that JavaScript provides.

Creating a Node.js clone starting with int main()

This talk will provide knowledge about the internals of Node.js that you cannot get anywhere else. You will leave with a more thorough understanding about the Node.js event loop and how asynchronous I/O is handled. We will integrate the two most important projects that make Node.js possible (Google V8 and libuv) to build a Node.js clone. Using this clone, we will create a simple TCP server to handle HTTP requests from JavaScript.

How I built an automated meat smoker on Ardui

@dynajoe
dynajoe / index.html
Created December 26, 2014 06:19
Same Game in HTML
<html>
<head>
<script type="text/javascript">
window.onload = function () {
var canvas = document.getElementById('game-canvas');
var context = canvas.getContext("2d");
context.fillStyle = "#0000FF";
var radius = 30;
var x = 250;
@dynajoe
dynajoe / gist:446b041b6a388cb6a769
Last active August 29, 2015 14:25 — forked from simonmorley/gist:d16261a1b45e28af6455
Google Cloud Compute Create Snapshot with Rotate
#!/bin/ruby
require 'json'
require 'time'
require 'syslog'
class Snapshot
def initialize()
@format = 'json'
@dynajoe
dynajoe / pg_replace_prepared.js
Last active June 26, 2018 20:23
pg_replace_prepared.js
#!/usr/bin/env node
process.stdin.setEncoding('utf8');
var data = '';
process.stdin.on('readable', function() {
var chunk = process.stdin.read();
if (chunk !== null) {