Skip to content

Instantly share code, notes, and snippets.

View hacknightly's full-sized avatar
:octocat:
On Github

Darrell Banks hacknightly

:octocat:
On Github
View GitHub Profile
;; emacs housekeeping
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(global-auto-revert-mode 1)
(setq warning-minimum-level :emergency)
;; pixel scroll
(setq pixel-scroll-precision-mode 1)
;; don't create lock files
@hacknightly
hacknightly / random-walk.html
Created April 5, 2019 04:24
A Random Walk in JavaScript
<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 02:29
Wikipedia Page Downloader
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 March 14, 2016 23:52
My dope sublime theme based on Chelvera
<?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>
@hacknightly
hacknightly / app.js
Last active November 16, 2015 18:41 — forked from superherointj/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])) {
<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
import {bootstrap} from ‘angular’;
import {TodoApp} from ‘todoapp’;
bootstrap(todoApp);
// AtScript Component
@Component({
selector: 'todo-app',
template: new TemplateConfig({
url: '/todos.html'
})
});
// Component Controller
class TodoApp {
@hacknightly
hacknightly / vtk_loader.js
Created April 26, 2013 14:56
A VTK file loader for three.js, thanks Mr. Doob
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.VTKLoader = function () {};
THREE.VTKLoader.prototype = {
constructor: THREE.VTKLoader,
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###