Skip to content

Instantly share code, notes, and snippets.

@markrendle
markrendle / More.txt
Created February 27, 2014 14:35
Ultra-private field: force access of variable via property even within class
OK, so technically within the class you can still access the variable by calling getMyProperty or setMyProperty instead of via the property, but you still encapsulate the functionality with the getting and setting.
@jbtule
jbtule / keyczar-make-data.sh
Last active December 11, 2015 00:58
Create test data for keyczar via bourne shell script.
#!/bin/sh -x
./testdata-script.sh "cs" "mono KeyczarTool.exe"
# python requires http://code.google.com/r/jtuley-python-collisions/
./testdata-script.sh "py" "python keyczar/keyczart.py"
# java requires http://code.google.com/r/jtuley-java-usekey-interop/
./testdata-script.sh "j" "java -jar KeyczarTool.jar"
@jbtule
jbtule / create-nuget.bat
Last active December 16, 2015 18:59
Create,Publish Nuget Package w/ Symbols&Source
@echo off
IF %1.==. GOTO WrongArgs
..\.nuget\nuget.exe pack ..\%1\%1.csproj -Build -Properties Configuration=Release -Symbols
GOTO:EOF
:WrongArgs
ECHO "create-nuget <projectname>"
@jbtule
jbtule / LosslessJson.csx
Created May 25, 2013 01:37
This example was inspired by "Serialization is Lossy" http://kellabyte.com/2013/05/02/serialization-is-lossy/
using ImpromptuInterface;
using Newtonsoft.Json.Linq;
/*
* This example was inspired by
* "Serialization is Lossy"
* http://kellabyte.com/2013/05/02/serialization-is-lossy/
*/
open System.Linq
[<EntryPoint>]
let main argv =
let counter = List.fold (fun (a,c,g,t) x -> match x with
| 'A' -> (a+1, c, g, t )
| 'C' -> (a, c+1, g, t )
| 'G' -> (a, c, g+1, t )
| 'T' -> (a, c, g, t+1)
@jbtule
jbtule / PCLBuildServerNotes.md
Last active December 20, 2015 10:49
Notes on installing portable library Profile support for build servers!
  • Visual Studio 2012 Pro Update 2 buy
  • Portable Library Tools 2 (install with /buildmachine from command line) download
  • Mono 3.2.4 stable download
  • Windows Phone 8 sdk (Requires Windows 8) download
@bragma
bragma / AzureStorageEmulatorManager.cs
Created December 5, 2014 10:12
SetUp Fixture for NUnit starting the emulator before tests
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AzureTableStorage.Tests
{
// Start/stop azure storage emulator from code:

Install postgresql

(The best SQL database)

Mac:

Best bet is to use http://postgresapp.com/ .

Make sure to set up your path once it's installed:

  1. Run atom ~/.bash_profile.
@jbtule
jbtule / haveibeenpwned.csx
Last active March 13, 2019 17:01
haveibeenpwned.com script to check a password
#!/usr/bin/env dotnet-script
/*
* This work (haveibeenpwnded.csx by James Tuley),
* identified by James Tuley, is free of known copyright restrictions
* Source: https://gist.github.com/jbtule/7dab1a1031590209bdcfac88ee71cb2b
* http://creativecommons.org/publicdomain/mark/1.0/
*
* This script uses the Troy Hunt's HaveIBeenPwned.com range api, to search for passwords,
* without revealing what you are searching for.
*
@seancoyne
seancoyne / fix-google-drive-menu-bar-icons.sh
Created October 21, 2014 15:34
Fix Google Drive Yosemite Dark Mode Menu Bar Icons
#!/usr/bin/env bash
# change to proper directory
cd /Applications/Google\ Drive.app/Contents/Resources/
# back up the files
sudo mkdir icon-backups
sudo cp mac-animate*.png icon-backups/
sudo cp mac-error*.png icon-backups/
sudo cp mac-inactive*.png icon-backups/