Skip to content

Instantly share code, notes, and snippets.

View tazjin's full-sized avatar
🥝
computers

tazjin

🥝
computers
View GitHub Profile
@tazjin
tazjin / AcidTest.hs
Created March 11, 2012 21:23
SafeCopy instance?
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, RecordWildCards,
TemplateHaskell, TypeFamilies, OverloadedStrings #-}
module Main where
import Control.Applicative ((<$>), optional)
import Control.Exception (bracket)
import Control.Monad (msum, mzero)
import Control.Monad.Reader (ask)
import Control.Monad.State (get, put)
import Control.Monad.Trans (liftIO)
@tazjin
tazjin / SOFTWARE_FIRMS.md
Created March 19, 2012 13:31 — forked from mbbx6spp/SOFTWARE_FIRMS.md
Companies using Haskell (trading firms and non-trading firms)
@tazjin
tazjin / gist:3456506
Created August 24, 2012 22:33
Uses Haskell types to turn a String into garbage.
import Data.List (sort)
-- |Type which holds a single character depending
-- on what it is.
data CharType = Consonant Char
 | Vowel Char
| Other Char
deriving (Eq)
instance Show CharType where
@tazjin
tazjin / plasma.hs
Last active December 17, 2015 20:09 — forked from possan/plasma.hs
-- haskell plasma attempt
-- compile with: ghc plasma.hs
-- run: plasma 80 50
import Control.Concurrent (forkIO, threadDelay)
import System.Environment
import System.Exit (exitSuccess)
coordValue :: Float -> Float -> Float -> Float
coordValue x y t =
(defun zeph-message-json (message-id receiver-id method-name &optional args)
"Creates the JSON array for a Zephyros message"
(json-encode `(,message-id ,receiver-id ,method-name ,(if args args))))
(defun zeph-send-msg (receiver-id method-name &optional args)
"Sends a message to the Zephyros connection and return the
message ID. The ID will always be an integer, if a string
is returned an error has occured."
(let* ((zephconn (get-process "zephconn"))
>
tqc -d script -framework Carbon -u framework AppKit -framework ApplicationServices -o xnomad.bin
2013-10-04 11:06:19.264 tranquil[2090:303] Source/Tranquil/CodeGen/TQProgram.mm:410 (-[TQProgram _parseScript:withPath:error:]): <blk@ {
<import: WindowManager>
<import: Hotkeys>
<import: Layouts>
<multiassgn@<var(local)@ wm>, = <msg@ <msg@ <const@ WindowManager> <arg@ new: (null)> . (autoreleased)> <arg@ setDefaultRatio: <num@ 0.700000>> .>, >
<multiassgn@<var(local)@ mgr>, = <msg@ <const@ HotkeyManager> <arg@ new: (null)> . (autoreleased)>, >
<multiassgn@<var(local)@ mod1>, = <array@[<str@ "option">, <str@ "control">, ]>, >
<multiassgn@<var(local)@ mod2>, = (<var(local)@ mod1> + <array@[<str@ "command">, ]>), >
> tranquil -aot -o test.llvm -d -arch x86_64 xnomad [/A/X/C/Resources]
2013-10-04 14:29:22.751 tranquil[5318:507] Source/Tranquil/CodeGen/TQProgram.mm:410 (-[TQProgram _parseScript:withPath:error:]): <blk@ {
<import: WindowManager>
<import: Hotkeys>
<import: Layouts>
<multiassgn@<var(local)@ wm>, = <msg@ <msg@ <const@ WindowManager> <arg@ new: (null)> . (autoreleased)> <arg@ setDefaultRatio: <num@ 0.700000>> .>, >
<multiassgn@<var(local)@ mgr>, = <msg@ <const@ HotkeyManager> <arg@ new: (null)> . (autoreleased)>, >
<multiassgn@<var(local)@ mod1>, = <array@[<str@ "option">, <str@ "control">, ]>, >
<multiassgn@<var(local)@ mod2>, = (<var(local)@ mod1> + <array@[<str@ "command">, ]>), >
<multiassgn@<msg@ <var(local)@ wm> <arg@ windowChecker: (null)> .>, = <blk@ {__blockPtr, win|
> lldb tranquil [/A/X/C/Resources]
Current executable set to 'tranquil' (x86_64).
(lldb) r -aot -o test.llvm -d -arch x86_64 xnomad
Process 5621 launched: '/usr/local/tranquil/bin/tranquil' (x86_64)
2013-10-04 14:35:58.975 tranquil[5621:d0b] Source/Tranquil/CodeGen/TQProgram.mm:410 (-[TQProgram _parseScript:withPath:error:]): <blk@ {
<import: WindowManager>
<import: Hotkeys>
<import: Layouts>
<multiassgn@<var(local)@ wm>, = <msg@ <msg@ <const@ WindowManager> <arg@ new: (null)> . (autoreleased)> <arg@ setDefaultRatio: <num@ 0.700000>> .>, >
<multiassgn@<var(local)@ mgr>, = <msg@ <const@ HotkeyManager> <arg@ new: (null)> . (autoreleased)>, >
(lldb) bt
* thread #1: tid = 0x3bade, 0x00000001009f7ac0 libtranquil_codegen.dylib`llvm::CallInst::CallInst(llvm::Value*, llvm::Twine const&, llvm::Instruction*) + 32, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
frame #0: 0x00000001009f7ac0 libtranquil_codegen.dylib`llvm::CallInst::CallInst(llvm::Value*, llvm::Twine const&, llvm::Instruction*) + 32
frame #1: 0x00000001001439f5 libtranquil_codegen.dylib`llvm::CallInst::Create(llvm::Value*, llvm::Twine const&, llvm::Instruction*) + 69
frame #2: 0x0000000100143861 libtranquil_codegen.dylib`llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateCall(llvm::Value*, llvm::Twine const&) + 81
frame #3: 0x000000010014d64c libtranquil_codegen.dylib`-[TQNodeImport generateCodeInProgram:block:root:error:] + 1516
frame #4: 0x000000010014076d libtranquil_codegen.dylib`-[TQNodeBlock _generateInvokeInProgram:root:block:error:] + 14461
frame #5: 0x00000001001432cd libtranquil_cod

Why I Switched Back to an iPhone

Yesterday I switched back from my Nexus 4 running Android 4.3 to a brand new (pink!) iPhone 5C.

This is a compilation of reasons, prompted partly by people telling me that "Apple is just now catching up to companies like Samsung".

To uninformed people reading this - short clarification, the 5C is not Apple's top-of-the-line phone. That would be the 5S.

Hardware