Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Collections.Concurrent; | |
namespace Praeclarum | |
{ | |
/// <summary> | |
/// Wraps a value and only allows access to it using a single thread | |
/// of execution (see SingleThreadQueue). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works for me. You may need to tweak it. Stick it in your powershell profile FTW | |
function Rename-Project | |
{ | |
# designed to run from the solution directory where the project is a child directory | |
param( | |
[string]$projectName=$(throw "projectName required."), | |
[string]$newProjectName=$(throw "newProjectName required.") | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let subscribeAsAsyncSeq (conn:IEventStoreConnection) (stream:string) (resolveLinks:bool) (bufferSize:int) (ct:CancellationToken) = asyncSeq { | |
use buffer = new System.Collections.Concurrent.BlockingCollection<ResolvedEvent>(bufferSize) | |
let inline onEvent subs (evt:ResolvedEvent) = | |
buffer.Add(evt) | |
let inline onDrop (subs:EventStoreSubscription) (reason:SubscriptionDropReason) (ex:exn) = | |
printfn "SUBSCRIPTION DROPPED! last position=%i reason=%O ex=%O" (subs.LastEventNumber.GetValueOrDefault()) reason ex | |
() | |
let! subs = conn.SubscribeToStreamAsync(stream, resolveLinks, Action<_,_>(onEvent), Action<_,_,_>(onDrop), null) |> Async.AwaitTask | |
yield! buffer.GetConsumingEnumerable(ct) |> AsyncSeq.ofSeq | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
This gist runs a 3 in memory node EventStore cluster | |
and a client that send messages to the cluster | |
To use the web interface, copy EventStore web folders. | |
You can found them in the server distribution at http://geteventstore.com/downloads/. | |
Then connect to http://localhost:2113/ | |
You can view the cluster status at: | |
http://localhost:2113/web/gossip.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r c242bbf5fa8c src/pkg/crypto/tls/common.go | |
--- a/src/pkg/crypto/tls/common.go Wed Jul 17 14:03:27 2013 -0400 | |
+++ b/src/pkg/crypto/tls/common.go Thu Jul 18 13:45:43 2013 -0400 | |
@@ -44,6 +44,7 @@ | |
// TLS handshake message types. | |
const ( | |
+ typeHelloRequest uint8 = 0 | |
typeClientHello uint8 = 1 | |
typeServerHello uint8 = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function aws_config | |
if not fgrep -q "[$argv]" ~/.aws/credentials | |
echo "Please specify a valid profile." | |
else | |
set -e AWS_ACCESS_KEY | |
set -e AWS_SECRET_KEY | |
set -g -x ATLAS_TOKEN (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"atlas_token\") { print \$3 }}" ~/.aws/credentials) | |
set account (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"account_id\") { print \$3 }}" ~/.aws/credentials) | |
set username (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"username\") { print \$3 }}" ~/.aws/credentials) | |
set mfarn "arn:aws:iam::$account:mfa/$username" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My name is {{.Name}} and I'm {{.Age}} years old!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Send a private message to someone on slack | |
# from the command line. | |
# Print a usage message and exit. | |
usage(){ | |
local name=$(basename "$0") |