I hereby claim:
- I am pyrtsa on github.
- I am pyrtsa (https://keybase.io/pyrtsa) on keybase.
- I have a public key whose fingerprint is 9215 CD40 D8F3 0BCA 0428 64DE D8D8 B2C7 FEBC 8EE6
To claim this, I am signing this object:
#include <string> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
[[gnu::format(printf, 1, 2)]] | |
auto format(const char * fmt, ...) -> std::string { | |
va_list args1; | |
va_start(args1, fmt); | |
va_list args2; |
import Foundation | |
struct P : CustomStringConvertible { | |
var p: OpaquePointer? | |
init(_ p: OpaquePointer?) { | |
self.p = p | |
} | |
var description: String { |
#!/bin/bash | |
limit="${1-10000000}"; | |
echo "Keeping SourceKitService below $limit KiB of virtual memory." | |
echo "Hit ^C to quit." | |
while true; do | |
sleep 1; | |
p=`pgrep ^SourceKitService$` | |
if [ -n "$p" ]; then | |
vsz=`ps -o vsz -p "$p" | tail -1` |
// Toggle this boolean to compare against stdlib: | |
#if true // Stdlib version | |
// Quick hack to avoid changing the AnyEquatable implementation below. | |
extension Equatable { typealias EqualSelf = Self } | |
#else // Modified version | |
protocol Equatable { |
function y = approx(x, n) | |
% APPROX Round the number to 1+n significant digits. | |
% y = APPROX(x) shorthand for round(x, 4, 'significant'). | |
% y = APPROX(x, n) shorthand for round(x, 1 + n, 'significant'). | |
% Copyright 2016 Pyry Jahkola | |
if nargin < 2 | |
n = 3; | |
end |
export _ps1_timer | |
function _ps1_timer_start { | |
# echo START | |
_ps1_timer=${_ps1_timer:-`gdate +%s%N 2> /dev/null || date +%s%N`}; | |
} | |
function _ps1_timer_stop { | |
# echo STOP | |
if [ -z "$_ps1_timer" ]; then |
struct Eq : Equatable { | |
let unbox: Any | |
let equal: Any -> Bool | |
init(value: Any, equal: Any -> Bool) { | |
self.unbox = value | |
self.equal = equal | |
} | |
init<T : Equatable>(_ value: T) { | |
self.init(value: value) { any in | |
guard let other = any as? T else { return false } |
-- Show loaded modules in window title and use a green "λ>" as prompt. | |
-- Subsequent lines of multi-line commands shall begin with " |". | |
:set prompt "\SOH\ESC]0;GHCi: %s\BEL\ESC[32;1m\STXλ>\SOH\ESC[0m\STX " | |
:set prompt2 "\SOH\ESC[32;1m\STX |\SOH\ESC[0m\STX " | |
-- Paste and evaluate text from the OS X clipboard. (The pasted text also | |
-- prints in yellow unless pasting quietly using :paste-quiet.) | |
:set -package process | |
:def paste \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in putStrLn ("\SOH\ESC[33m\STX" ++ paste ++ "\SOH\ESC[0m\STX") >> return (":cmd return " ++ show cmd) } | |
:def paste-quiet \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in return (":cmd return " ++ show cmd) } |
infix operator « { associativity left } | |
infix operator »« { associativity left } | |
postfix operator » {} | |
struct Index { | |
let value: Int | |
} | |
enum Error : ErrorType { | |
case OutOfBounds(index: Int, count: Int) |
I hereby claim:
To claim this, I am signing this object: