Skip to content

Instantly share code, notes, and snippets.

🏦
Banking on JavaScript

Darrell Banks hacknightly

Block or report user

Report or block hacknightly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hacknightly
hacknightly / random-walk.html
Created Apr 5, 2019
A Random Walk in JavaScript
View random-walk.html
<html>
<head>
<style>
body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
display: flex;
justify-content: center;
@hacknightly
hacknightly / downloader.js
Last active May 23, 2017
Wikipedia Page Downloader
View downloader.js
import * as https from "../lib/https";
import * as http from "http";
import * as htmlparser from "htmlparser2";
import { HTML, DownloaderResult } from "./types";
export default class Downloader {
parser : htmlparser.Parser;
collecting : boolean;
done : boolean;
@hacknightly
hacknightly / hacknightly.tmTheme
Created Mar 14, 2016
My dope sublime theme based on Chelvera
View hacknightly.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Hacknightly</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
View app.js
// Hello. I'm learning. Thank you for sharing your insights.
var sUtil = require('sUtils.js');
var obj = {
a:[1,2],
b:[3,4],
}
Object.keys(obj).forEach(function(key) {
if (Array.isArray(obj[key])) {
View gist:5c75c3556667f98767ad
<div> My name is {{name}} </div>
<div>
<!-- '#' creates a local variable called newname -->
<input #newname type="text" />
<!-- newname can now be used locally -->
<button (click)="changeName(newname.value)"
[disabled]="newname.value === 'david'">
<!-- (click) is an event binding that can take any event registered in the DOM -->
<!-- [disabled] is an attribute binding -->
Change Name
View gist:931af1c5e29903ee2801
import {bootstrap} from ‘angular’;
import {TodoApp} from ‘todoapp’;
bootstrap(todoApp);
View gist:f037ec38df99347b8249
// AtScript Component
@Component({
selector: 'todo-app',
template: new TemplateConfig({
url: '/todos.html'
})
});
// Component Controller
class TodoApp {
@hacknightly
hacknightly / vtk_loader.js
Created Apr 26, 2013
A VTK file loader for three.js, thanks Mr. Doob
View vtk_loader.js
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.VTKLoader = function () {};
THREE.VTKLoader.prototype = {
constructor: THREE.VTKLoader,
View StreamingResponse.coffee
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###
View show.jade
script(id='pageTpl', type='text/html')
| <div class="page">
| <div class="head"><%=title%> - <%=path%></div>
| <div class="body">
| <ul>
| <% _(actions).each(function(action) { %>
| <li>
| <%=action.name%> - <%=Helpers.df(action.time)%>
| <% if (action.ext) { %>
| <i class="pop icon-info-sign" data-content="<%=_.template($('#extTpl').html(), action)%>" data-original-title="Extra Information"></i>
You can’t perform that action at this time.