Skip to content

Instantly share code, notes, and snippets.

View everettcaleb's full-sized avatar

Caleb Everett everettcaleb

  • Apple
  • Austin, TX
View GitHub Profile
@everettcaleb
everettcaleb / right-click-for-bash.reg
Last active August 29, 2015 13:57
Registry File to Add Right-Click for Bash in Windows 7/8/8.1
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\RightClickForBash]
@="Open Bash Shell Here"
[HKEY_CLASSES_ROOT\Directory\shell\RightClickForBash\Command]
@="c:\cygwin64\bin\bash.exe"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\RightClickForBash]
@="Open Bash Shell Here"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\RightClickForBash\Command]
@="c:\cygwin64\bin\bash.exe"
[HKEY_CLASSES_ROOT\Folder\shell\RightClickForBash]
@everettcaleb
everettcaleb / full-text-view.sql
Created May 26, 2014 02:41
Full Text Index on VIEW to pull in JOIN data (T-SQL)
---------------------------------------------------
-- Users table
---------------------------------------------------
CREATE TABLE [Accounts].[Users]
(
[UserId] INT IDENTITY(1,1) NOT NULL,
[Username] VARCHAR(50) NOT NULL,
[Email] VARCHAR(255) NOT NULL,
[EmailIsVerified] BIT NOT NULL CONSTRAINT [DF_Users_EmailIsVerified] DEFAULT 0,
[CreationDate] DATETIME NOT NULL CONSTRAINT [DF_Users_CreationDate] DEFAULT GETDATE(),
SELECT * FROM Inspections.SearchableTemplates
WHERE CONTAINS(*, '"test*"')
@everettcaleb
everettcaleb / random-characters.c
Last active August 29, 2015 14:02
Dumb Assignment program with a custom Mersenne-twister implementation (in C)
// characters.c
// Author: Caleb Everett
// Assignment: #3
// Created on 6/8/2014
// Purpose: Generate two random characters using one of four functions and user input, includes
// Mersenne-twister implementation based on the pseudocode from the Wikipedia article
// (http://en.wikipedia.org/wiki/Mersenne_twister#Pseudocode)
#include <stdio.h>
#include <time.h>
@everettcaleb
everettcaleb / funnamegame.c
Created June 12, 2014 13:46
Making my homework unreadable while still maintaining proper functionality using the C Preprocessor
// funnamegame.c
// Assignment: 4
// Author: Caleb Everett
// Creation Date: 6/12/2014
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <ctype.h>
#define CREATE
@everettcaleb
everettcaleb / obnamegame.c
Created June 12, 2014 17:47
The homework, again, this time even MORE unreadable ;)
#define $a static
#define $b const
#define $c char
#define $d *
#define $e VOWELS
#define $f "AEIOU"
#define $g NAME_GAME_FORMAT
#define $h "%s, %s, bo-b%s\r\nBanana-fana fo-f%s\r\nFee-Fi-mo-m%s\r\n%s!\r\n"
#define $i int
#define $j PrintNameGame
@everettcaleb
everettcaleb / oval-fade.sass
Created August 14, 2014 18:28
A SASS snippet to do something similar to the oval fade effect in the Google Material Design docs
$color-header: #fff
$color-alttext: #fff
a
background-color: $color-header
border-radius: 40px
color: $color-alttext
transition: color ease 0.75s, background-color ease 0.75s, border-radius ease 1s
&:hover
@everettcaleb
everettcaleb / fast_inverse_sqrt.c
Created November 13, 2014 17:27
Fast (not exact) Inverse Square Root (from Quake source code)
float fast_inverse_sqrt(float number)
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = *(long*)&y;
i = 0x5f3759df - (i >> 1);
@everettcaleb
everettcaleb / identifier-enum.h
Created December 24, 2014 02:08
Identifier Enumeration Example
#pragma once
#ifndef INCLUDE_PHOENIX_EVID_H
#define INCLUDE_PHOENIX_EVID_H
enum EVID : unsigned int {
EVID_TICK = 1,
EVID_SWITCH_TO_FOREGROUND = 2,
EVID_SWITCH_TO_BACKGROUND = 3
};
@everettcaleb
everettcaleb / fisher-yates.cs
Last active August 29, 2015 14:13
Fisher-Yates Shuffle for Random Permutations
using System;
using System.Diagnostics;
using System.Text;
namespace norepeat
{
public static class Extensions
{
public static string FormatForPadZeroUpTo( this int range )
{