Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kanedo
kanedo / interpretation.tex
Last active August 29, 2015 14:04
LaTeX Interpretation
\usepackage{MnSymbol}
\newcommand{\interp}[2][I]{\lsem #2\rsem^\mathfrak{#1}}
%
% Usage:
% Two modes available.
\interp{\varphi} % translates to Intepretaion of \varphi in \mathfrak{I}
%
% or specifiy Interpretation
\interp[X]{\varphi} % translates to Intepretaion of \varphi in \mathfrak{X}
@kanedo
kanedo / gist:6b787ea20c18938391ea
Created July 15, 2014 08:01
open in Dolphin Bookmarklet
javascript:window.location=('dolphin://'+window.location.host+window.location.pathname)
@kanedo
kanedo / Makefile
Last active May 7, 2020 00:55
Makefile for Xcode C++ projects
#############################################################
# #
# Generic Makefile for C++ projects #
# Author: Gabriel <software@kanedo.net> #
# Date: 2014-04-18 #
# Version: 1.0 #
# #
#############################################################
<?php # -*- coding: utf-8 -*-
/**
* Create a nav menu with very basic markup.
*
* @author Thomas Scholz http://toscho.de
* @version 1.0
*/
class T5_Nav_Menu_Walker_Simple extends Walker_Nav_Menu
{
/**
#!/usr/bin/python
# CLI program to control the mediakeys on OS X. Used to emulate the mediakey on a keyboard with no such keys.
# Easiest used in combination with a launcher/trigger software such as Quicksilver.
# Main part taken from http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac
# Glue to make it into cli program by Fredrik Wallner http://www.wallner.nu/fredrik/
import Quartz
import sys
@kanedo
kanedo / fermat.hs
Created December 19, 2012 20:12
Fermat's little theorem
fermat :: (Integral i, Show i) => i -> Bool
fermat 1 = True -- Fermat's litte theorem only works for
fermat 2 = True -- numbers greater then 2
fermat x = not (null [x | y<-[2.. pred x], (y^(x-1) `mod` x) == 1])
@kanedo
kanedo / function.php
Created September 13, 2012 09:32
Add language descriptor to wordpress adminbar
/*
Plugin Name: Language Descriptor for admin Bar
Plugin URI: http://kanedo.net
Description: Add language descriptor to wordpress adminbar
Version: 1.0
var mobileVersion = function(){
var version = 0.0;
if(isMobile.iOS()){
version = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
.replace('undefined', '3_2').replace('_', '').replace('_', '')
) || false;
}
if(isMobile.Android()){
var isIOS = {
iPhone: function(){
return navigator.userAgent.match(/iPhone/i) ? true : false;
},
iPad: function(){
return navigator.userAgent.match(/iPad/i) ? true : false;
},
iPod: function(){
return navigator.userAgent.match(/iPod/i) ? true : false;
},