Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
defmodule MyApp.CLI do
def main(_args) do
IO.puts("Hello from MyApp!")
end
end
@victusfate
victusfate / golang_job_queue.md
Created January 24, 2017 22:35 — forked from harlow/golang_job_queue.md
Job queues in Golang
@victusfate
victusfate / pushNotifier
Created September 30, 2016 15:16 — forked from ranacseruet/pushNotifier
A simple NodeJS script, to implement apple push notification service
var apn = require("apn")
var apnError = function(err){
console.log("APN Error:", err);
}
var options = {
"cert": "cert.pem",
"key": "key.pem",
"passphrase": null,
@victusfate
victusfate / aws-sns-example.js
Last active July 19, 2018 06:23 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@victusfate
victusfate / libdnet_python.rb
Created December 8, 2015 22:49 — forked from benhagen/libdnet_python.rb
Install Scapy on OSX through Homebrew
require 'formula'
class LibdnetPython <Formula
depends_on 'libdnet'
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz'
homepage 'http://code.google.com/p/libdnet/'
sha1 '71302be302e84fc19b559e811951b5d600d976f8'
def install
ENV["CFLAGS"] = "-O3 -w -pipe"
@victusfate
victusfate / generate-pushid.js
Created December 8, 2015 17:02 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@victusfate
victusfate / GameViewController.swift
Created October 23, 2015 22:38 — forked from kconner/GameViewController.swift
Xcode 6.3 OpenGL Game template ported to Swift. (Add "-D DEBUG" to Other Swift Flags setting)
import GLKit
// Uniform index.
private enum Uniform {
case ModelViewProjectionMatrix, NormalMatrix
}
private var gUniforms: [Uniform: GLint] = [:]
extension GLKMatrix3 {
var array: [Float] {
//This was taken from the Swift OpenGL Example on GitHub
// View code
import Foundation
import UIKit
import QuartzCore
import OpenGLES
import GLKit
@victusfate
victusfate / app.rb
Last active August 29, 2015 14:20 — forked from jamiehodge/app.rb
require 'sinatra'
require 'slim'
require 'coffee-script'
require 'sass'
require 'sequel'
DB = Sequel.sqlite
DB.create_table :uploads do
String :id, text: true, primary_key: true
//
// Swift-KVO
//
// Created by Jim Correia on 6/5/14.
// Copyright (c) Jim Correia. All rights reserved.
//
// Update: 6/17/2014
//
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context