Skip to content

Instantly share code, notes, and snippets.

View bytorbrynden's full-sized avatar

Brynden bytorbrynden

View GitHub Profile
var getTime = function() {
var _date = new Date();
var hours = _date.getHours();
var minutes = _date.getMinutes();
var am_pm = (hours >= 12 ? "PM" : "AM");
return Math.round(hours / 12) + ":" + minutes + " " + am_pm;
};
@bytorbrynden
bytorbrynden / fuzzbizz.output.txt
Created May 31, 2016 00:45
The output from my fuzzbizz program
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
@bytorbrynden
bytorbrynden / gist:ea8c13abe2abcbf4ba4d723d8442f9d8
Created April 14, 2016 22:10
Check if two strings are anagrams
var testCases = [
["aab", "baa"],
["bac", "bbc"]
];
var isAnagram = function(first, second) {
return (
first.split("").sort().join("") === second.split("").sort().join("")
);
};
@bytorbrynden
bytorbrynden / keybase.md
Created March 20, 2016 17:13
keybase.md

Keybase proof

I hereby claim:

  • I am Gigabyte-Giant on github.
  • I am gigabytegiant (https://keybase.io/gigabytegiant) on keybase.
  • I have a public key whose fingerprint is 0B33 284A 2843 5149 0497 CAA6 9FC8 2EB6 B679 C12C

To claim this, I am signing this object:

// This is supposed to be an implementation of C's "strcmp" function,
// but it looks like something is missing...
int strcmp(c_string s1, c_string s2)
{
const size_t str1_len = strlen(s1);
const size_t str2_len = strlen(s2);
if (str1_len < str2_len)
{
return -1;
// ...taken from one of my other projects-- also using sass/scss.
var gulp = require("gulp");
var sass = require("gulp-sass");
// This will watch for changes in the directory that you specify, apply sass, and output it to the directory you specify.
gulp.task("styles", function() {
gulp.src("<your sass directory>")
.pipe(sass().on("error", sass.logError))
.pipe(gulp.dest("<your output directory>"));
});
@bytorbrynden
bytorbrynden / machine_word.cpp
Created March 24, 2015 15:01
A super-simple way to determine the word size of a processor; in C/C++.
/* MACHINE_WORD is the word size of the processor. It can be determined, by multiplying the size of a long, by 8. */
#define MACHINE_WORD sizeof(long) * 8