Skip to content

Instantly share code, notes, and snippets.

Pat Hawks pathawks

Block or report user

Report or block pathawks

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
View DSM-REG-2005-09-12-White-Belt.smt
(set-info :smt-lib-version 2.6)
(set-logic QF_LIA)
(set-option :produce-models true)
(set-info :status sat)
(declare-const board11 Int)(assert (= 1 board11))
(declare-const board12 Int)(assert (= 9 board12))
(declare-const board13 Int)(assert (and (<= 1 board13)(<= board13 9)))
(declare-const board14 Int)(assert (and (<= 1 board14)(<= board14 9)))
(declare-const board15 Int)(assert (and (<= 1 board15)(<= board15 9)))
(declare-const board16 Int)(assert (and (<= 1 board16)(<= board16 9)))
@pathawks
pathawks / index.js
Last active Apr 9, 2016
Slack Google slash command
View index.js
const qs = require('querystring');
const https = require('https');
const url = require('url');
const googleLink = function (text) {
const query = encodeURIComponent(text).replace(/%20/g,'+');
return "<https://www.google.com/search?q=" + query + "|google.com/search?q=" + query + ">";
}
const qrCode = function (url) {
@pathawks
pathawks / Swift.md
Last active Feb 19, 2016
I ❤️ Swift
View Swift.md

I ❤️ Swift

📜 View The Slides

About Swift Philosophy

Swift is friendly to new programmers. It is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language.

The compiler is optimized for performance, and the language is optimized for development, without compromising on either. It’s designed to scale from “hello, world” to an entire operating system.

@pathawks
pathawks / 99Bottles.s
Last active Oct 5, 2015
99 Bottles of Beer in MIPS
View 99Bottles.s
# filename: 99Bottles.s
# author: Pat Hawks <pat@pathawks.com>
.data
Lyric1:
.asciiz " bottles of beer on the wall\n"
Lyric2:
.ascii " bottles of beer\n"
.asciiz "Take one down, Pass it around\n"
Lyric3:
@pathawks
pathawks / ieeefloat.c
Last active Sep 30, 2015
IEEE 754 Explore
View ieeefloat.c
/**
* Shows how a number is represented as IEEE 754
*
* @author Pat Hawks
* Course: COMP B13
* Created: Sept 29, 2015
* Source File: ieeefloat.c
*/
#include <stdio.h>
View Challenge2.S
/**
* @author: Pat Hawks
* Created on: Mar 06, 2015
* Source File: Challenge2.s
*
* To compile:
* gcc Challenge2.s -o Challenge2
*/
.code32
@pathawks
pathawks / Test.cpp
Last active Aug 29, 2015
Test Framework
View Test.cpp
/**
* @author: Pat Hawks
* Created on: Feb 26, 2015
* Source File: Test.cpp
*/
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
@pathawks
pathawks / CHALLEN1.BAS
Last active Aug 29, 2015
Programming Challenge 1
View CHALLEN1.BAS
REM To run:
REM 1. Get a time machine
REM 2. Travel back to the early 90s
REM 3. In MS-DOS 5+, run `qbasic /run CHALLEN1.BAS`
10 PRINT "Enter a whole number between 1000 and 999999 without spaces or commas."
20 INPUT "", N&
30 IF N& < 1000 OR N& > 999999 THEN GOTO 10
40 PRINT LTRIM$(STR$(INT(N& / 1000)));
50 PRINT ",";
@pathawks
pathawks / GCC Options-en.md
Last active Aug 29, 2015
Common GCC Options
View GCC Options-en.md
Option Explanation
-o <OutputFile> Specify name of output file
-Wall Shows all warning messages
-Wextra Shows even more warning messages
-g Include debug information in output (For debugging with gdb)
-gstabs Include debug information in output (-g is preferred)
-c Do not link; output object file (Does not produce .exe)
-S Do not assemble; output assembler code.
-O0 Do not optimize output (Useful for debugging)
You can’t perform that action at this time.