Skip to content

Instantly share code, notes, and snippets.

View forrestbthomas's full-sized avatar

Forrest Thomas forrestbthomas

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char result[512];
void char_to_hex(char char_input, int should_copy)
{
char *result_char;
switch(char_input)
{
@forrestbthomas
forrestbthomas / gist:b3c7e7128e9ab8c5f653
Created May 25, 2015 21:01
Detect single-character XOR
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int most_freq_chars(char *decrypt_attempt)
{
struct high_freq_characters {
int E;
int T;
int A;
@forrestbthomas
forrestbthomas / gist:b011842bc77e2812408b
Created May 25, 2015 19:50
Single-byte XOR cipher
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int most_freq_chars(char *decrypt_attempt)
{
struct high_freq_characters {
int E;
int T;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
char convert_int_to_hex(int arg)
{
char result;
switch(arg)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int convert_int_to_base_64(int arg)
{
char result;
switch(arg)
{
interface Collection {
push(value: number): void;
pop(): number;
peek(): number;
isEmpty(): boolean;
}
class Node {
value: number;
constructor(value: number) {
@forrestbthomas
forrestbthomas / gist:2aa01406f72e4072707c
Last active August 29, 2015 14:15
Typescript Stack
interface Collection {
pop(): number;
push(value: number): void;
peek(): number;
isEmpty(): boolean;
}
class Stack implements Collection {
value: number;
pointer: any;
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
// We are loading the groups where the current officer is a reviewer
var store = this.store;
return store.find('group-officer', {}).then(function(groups) {
var triggerStats = groups.map(function(group) {
return Ember.RSVP.all(group.get('group').get('topTriggers').map(function(topTrigger) {
return store.find('triggerStat', {