Skip to content

Instantly share code, notes, and snippets.

View yeukhon's full-sized avatar

Yeuk Hon Wong yeukhon

  • TikTok USDS / ByteDance
  • New York, NY
  • 06:04 (UTC -04:00)
View GitHub Profile
@yeukhon
yeukhon / helloworld.cpp
Created August 6, 2011 22:57
Hello World in C++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!";
return 0;
}
Library ieee;
Use ieee.std_logic_1164.all;
Entity test_two_bit_comparator is
-- empty
End test_two_bit_comparator;
Architecture arch of test_two_bit_comparator is
-- First, get our external comparator
@yeukhon
yeukhon / runner.py
Created September 28, 2012 20:09
runner.py
#!/usr/bin/env python
import yaml, json
from subprocess import Popen, PIPE
CONFIG_FILE = "config.yaml"
def read_config(filename):
with open(filename, "r") as f:
return yaml.load(f)
@yeukhon
yeukhon / simpleList.cpp
Created January 13, 2013 01:08
Simple List implementation in C++. Just my first attempt. So far only works for int. That's fine ...
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode ()
{
this->val = 0;
this->next = 0;
@yeukhon
yeukhon / .hgignore
Last active December 11, 2015 19:39
.hgignore You should ignore userdata/** and tell user to create it (or somehow you automate it).
# use glob syntax.
syntax: glob
*.swp
*.elc
*.pyc
*~
# switch to regexp syntax.
syntax: regexp
glasslab@flash:~/newworkstation/vagrant-example$ ansible -m setup 127.0.0.1 -u glasslab -k
SSH password:
127.0.0.1 | success >> {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"192.168.1.66"
],
"ansible_all_ipv6_addresses": [
"fe80::214:22ff:fe3a:768b"
],
function response_ok(x) {
return x >= 200 && x < 300;
};
function getUsername()
{
var username = doLMSGetValue( "cmi.core.student_id");
console.log(username);
console.log(doLMSGetValue( "cmi.core.student_name"));
return username;
function response_ok(x) {
return x >= 200 && x < 300;
};
function getUsername()
{
var username = doLMSGetValue( "cmi.core.student_id");
console.log(username);
console.log(doLMSGetValue( "cmi.core.student_name"));
return username;
## What machine is your central manager?
#CONDOR_HOST = $(FULL_HOSTNAME)
CONDOR_HOST = 10.0.2.15
## Pool's short description
COLLECTOR_NAME = Condor Master at $(FULL_HOSTNAME)
## When is this machine willing to start a job?
START = TRUE
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)