Skip to content

Instantly share code, notes, and snippets.

@buscarini
buscarini / Mastermind.hs
Last active Sep 29, 2016
Mastermind game in Haskell
View Mastermind.hs
module Mastermind
where
import System.Random
import Text.Read
import Data.Maybe
import Data.Char
data Color = Red | Green | Blue | Yellow | Brown | Orange | Black | White deriving (Show, Read, Eq, Ord, Bounded, Enum)
@buscarini
buscarini / remove_sim_dups.py
Created Jul 15, 2015
Remove Xcode duplicated simulators
View remove_sim_dups.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from subprocess import Popen, PIPE
from subprocess import call
p = Popen(["xcrun","simctl","list","devices"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"input data that is passed to subprocess' stdin")