Skip to content

Instantly share code, notes, and snippets.

Avatar

Cody Balos balos1

View GitHub Profile
View compare_rhs.cpp
/*
BSD 3-Clause License
Copyright (c) 2002-2021, Lawrence Livermore National Security and Southern Methodist University.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
View addTwoNumbers.cpp
#include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
/**
View hamming.c
#include "stdio.h"
int hammingDistance(int x, int y) {
int diff = x^y;
int distance = 0;
for (int i = 0; i < 32; ++i) {
if ((diff & (1 << i)) != 0) {
++distance;
}
}
View twosum.py
class Solution:
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
(num, idx) = (nums[0], 0)
dct = dict([(num, idx)])
for idx2, num2 in enumerate(nums[1:]):
View new-latex-homework.sh
#!/bin/bash
# console colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# project name comes top folder name by default
PROJECT=$(basename $PWD)
View latex-homework-gitignore
# Created by https://www.gitignore.io/api/latex
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
View rsync-backup.sh
#!/bin/zsh
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /media/cody/Backup/cbalos-nixtop
@balos1
balos1 / timing.h
Last active May 4, 2017
C/C++ macro for timing blocks of code
View timing.h
/*
File: timing.h
Author(s):
Cody Balos
Description:
Useful stuff for timing programs.
MIT License
Copyright (c) [2017] [Cody Balos]
View keybase.md

Keybase proof

I hereby claim:

  • I am cojomojo on github.
  • I am cojomojo (https://keybase.io/cojomojo) on keybase.
  • I have a public key ASBqujW0BwmCbhK4KbJqvLkybXQ8NAPOJxkOFHg9tH1eJAo

To claim this, I am signing this object:

@balos1
balos1 / lab_report.tex
Last active Oct 1, 2020
A Lab Report LaTex Template
View lab_report.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% University/School Laboratory Report
% LaTeX Template
% Version 3.1 (25/3/14)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Linux and Unix Users Group at Virginia Tech Wiki