Skip to content

Instantly share code, notes, and snippets.

View Morpheu5's full-sized avatar
☠️
🏍

Andrea Franceschini Morpheu5

☠️
🏍
View GitHub Profile
@Morpheu5
Morpheu5 / Logger.h
Last active December 22, 2015 09:19
A ridiculously lightweight logging singleton class suitable for multi-threading applications. Just include it, initialize it, set the thread up, and you are good to go.
/*
Copyright (c) 2013, Andrea Franceschini <andrea.franceschini@gmail.com>
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
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
@Morpheu5
Morpheu5 / process_trello.rb
Last active August 29, 2015 14:05
A thing that grabs a Trello board export in JSON and turns it into a rather badly formatted Markdown document.
#!/usr/bin/env ruby
require 'json_select'
require 'yajl'
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options]"
opts.separator ''
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Fbo.h"
#include "cinder/Perlin.h"
using namespace ci;
using namespace ci::app;
using namespace std;
#define IS_LANDSCAPE (getWindowWidth()/1.6f > getWindowHeight())
@Morpheu5
Morpheu5 / bft-test.cpp
Created November 25, 2015 21:56
A breadth-first tree traversal. #notetoself
#include <iostream>
#include <list>
using namespace std;
struct Node {
int value;
list<Node *> children;
};
@Morpheu5
Morpheu5 / .zshrc
Last active November 6, 2016 11:54
My ZSH RC
### 2016-11-06 (porto)
export R_HOME='/opt/local/Library/Frameworks/R.framework/Resources'
path+=(/opt/local/bin /opt/local/lib/mariadb-10.0/bin ~/.rvm/bin ~/anaconda/bin ~/.bin ~/.cabal/bin)
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
source ~/.antigen/antigen.zsh
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '>= 5.0.0'
package net.morpheu5.bleedingscorecalculator
import android.content.SharedPreferences
import android.os.Bundle
import android.support.v4.app.FragmentActivity
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentTransaction
import android.support.v7.preference.PreferenceFragmentCompat
import android.support.v4.app.Fragment
import android.support.v7.preference.PreferenceManager
[
{
"event_type":"OPEN"
},
{
"event_type":"DRAG_POTENTIAL_SYMBOL",
"type":"Symbol",
"properties":{
"letter":"C"
}
struct Element: Decodable {
struct BinaryOperationProperties: Decodable
{ let operation: String }
struct BracketsProperties: Decodable
{ let type: String }
struct ChemicalElementProperties: Decodable
{ let element: String }
struct DifferentialProperties: Decodable
{ let letter: String }
struct FunctionProperties: Decodable
@{%
const greekLetterMap = { "alpha": "α", "beta": "β", "gamma": "γ", "delta": "δ", "epsilon": "ε", "varepsilon": "ε", "zeta": "ζ", "eta": "η", "theta": "θ", "iota": "ι", "kappa": "κ", "lambda": "λ", "mu": "μ", "nu": "ν", "xi": "ξ", "omicron": "ο", "pi": "π", "rho": "ρ", "sigma": "σ", "tau": "τ", "upsilon": "υ", "phi": "ϕ", "chi": "χ", "psi": "ψ", "omega": "ω", "Gamma": "Γ", "Delta": "Δ", "Theta": "Θ", "Lambda": "Λ", "Xi": "Ξ", "Pi": "Π", "Sigma": "Σ", "Upsilon": "Υ", "Phi": "Φ", "Psi": "Ψ", "Omega": "Ω" }
const moo = require("moo");
const lexer = moo.compile({
Fn: ['cos', 'sin', 'tan',
'cosec', 'sec', 'cot',
'arccos', 'arcsin', 'arctan',
'arccosec', 'arcsec', 'arccot',
'cosh', 'sinh', 'tanh', 'cosech', 'sech', 'coth',