Skip to content

Instantly share code, notes, and snippets.

@jen20
jen20 / DateTimeExtensions.cs
Created June 9, 2014 17:23
Necessary patches to make skype-log-viewer export in the format for import into SlackHQ. This is obviously the worst code ever and the worst method of distributing it ever, but meh, works until I have more time to turn it into a proper command line utility. GPL I guess (since the upstream is).
using System;
namespace SkypeLogViewerLGG
{
public static class DateTimeExtensions
{
public static long ToUnixTimestamp(this DateTime target)
{
var date = new DateTime(1970, 1, 1, 0, 0, 0, target.Kind);
var unixTimestamp = Convert.ToInt64((target - date).TotalSeconds);
require 'formula'
class Macvim < Formula
homepage 'http://code.google.com/p/macvim/'
url 'https://github.com/b4winckler/macvim/tarball/snapshot-66'
version '7.3-66'
sha1 'd11696f7089688fa96a45fc57410c60f6ca5a394'
head 'https://github.com/b4winckler/macvim.git', :branch => 'master'
@jen20
jen20 / JetbrainsAnnotations.cs
Created June 19, 2014 12:14
A less annoying version of the Resharper annotations for R# 8. Makes classes and enums internal, puts them in System namespace.
#pragma warning disable 1591
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedParameter.Local
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable IntroduceOptionalParameters.Global
// ReSharper disable MemberCanBeProtected.Global
// ReSharper disable InconsistentNaming
// ReSharper disable once CheckNamespace
@jen20
jen20 / gist:d0060d3128158b43880c
Created July 14, 2014 17:50
On Mono 3.4.0 on OS X
~/scratchpad $ mono Program.exe
Environment: CLR 4.0.30319.17020 on Unix 13.2.0.0 (64 bit)
Int32Wrapper: 4
TwoInt32s: 8
TwoInt32Wrappers: 8
RefAndTwoInt32s: 16
RefAndTwoInt32Wrappers: 16
class people::jen20::vagrant {
class { 'vagrant':
version => '1.6.3'
}
vagrant::plugin { 'vagrant-vmware-fusion':
license => "${my_homedir}/.dotfiles/vagrant/license.lic",
require => Repository['dotfiles'];
}
PS C:\data\EventStore> .\scripts\nuget-clientapi\package-clientapi.ps1 9.9.9
Attempting to build package from 'EventStore.Client.nuspec'.
Successfully created package 'C:\data\EventStore\EventStore.Client.9.9.9.nupkg'.
Successfully created package 'C:\data\EventStore\EventStore.Client.9.9.9.symbols.nupkg'.
Attempting to build package from 'EventStore.Client.Embedded.nuspec'.
Successfully created package 'C:\data\EventStore\EventStore.Client.Embedded.9.9.9.nupkg'.
Successfully created package 'C:\data\EventStore\EventStore.Client.Embedded.9.9.9.symbols.nupkg'.
WARNING: 1 issue(s) found with package 'EventStore.Client.Embedded'.
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@jen20
jen20 / execution_plan_graph.png
Last active August 29, 2015 14:14
Currently working on this. Looking like the best available tooling for Azure provisioning so far!
execution_plan_graph.png
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
func getRandomProbablyAvailableSuffixedDnsName(prefix string, client *hostedservice.HostedServiceClient) (string, error) {
done := false
maybeName := ""
for done == false {
maybeName = fmt.Sprintf("%s-%d", prefix, rand.Intn(99999))
available, reason, err := client.CheckHostedServiceNameAvailability(maybeName)
if err != nil {
return "", fmt.Errorf("Error checking cloud service name availability: %s", err)
}