Skip to content

Instantly share code, notes, and snippets.

async void Main()
{
var content = "Hello, World!";
var size = QRCodeSize.Large;
var errorCorrection = QRErrorCorrection.H;
var qrUrl = GenerateQRCodeUrl(content, size, errorCorrection);
qrUrl.Dump();
var image = await GetQRCodeImage(qrUrl);
{
"cmd": ["jekyll", "build", "&&", "nircmd", "trayballoon", "Sublime Text", "Jekyll build completed", "C:\\Program Files\\Sublime Text 3\\sublime_text.exe", "3000"],
"shell": true
}
var qrCode = new CIQRCodeGenerator {
Message = NSData.FromString (someText),
CorrectionLevel = "Q"
}.OutputImage;
UIGraphics.BeginImageContext (new SizeF (qrCode.Extent.Width * 8, qrCode.Extent.Height * 8));
var cgCtx = UIGraphics.GetCurrentContext ();
var ciCtx = CIContext.FromOptions (null);
cgCtx.InterpolationQuality = CGInterpolationQuality.None;
cgCtx.DrawImage (cgCtx.GetClipBoundingBox (), ciCtx.CreateCGImage (qrCode, qrCode.Extent));
@phaufe
phaufe / android netrunner cards
Created February 11, 2014 10:20
android netrunner cards
#!/bin/bash
# Constants
CARD_ID_PREFIX=bc0f047c-01b1-427f-a439-d451eda
GAME_ID=0f38e453-26df-4c04-9d67-6d43de939c77
TMPDIR=tmp_builddir
BASE_URL="http://netrunnerdb.com/web/bundles/netrunnerdbcards/images/cards/en"
# Positional params
ZIP_NAME=${1}
SET_ID=${2}

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Getting Started

Here's how to take any EXE and create an installer for it:

  1. Install-Package squirrel.windows
  2. Use NuGet Package Explorer (or any other way) to create a NuGet package for your app.
  3. Open the NuGet Package Console, and type Squirrel --releasify path/to/the/nuget/package.nupkg

You should have a folder called Releases with three files in it. Publish those all to S3 in the same folder and you've now got an installer

using Xamarin.Forms;
// Additional guidance: see http://vincenth.net/blog/archive/2014/11/27/how-to-share-xamarin-forms-data-binding-code-across-xamarin-sketches-and-apps-without-using-strings.aspx
// NOTE: Once support for creating classes is added to Xamarin Sketches,
// there is no need for this Tuple + enum + BindName + regular expression workaround;
// you can then simply create design data classes in the Sketch and bind to that using
// the same syntax in both projects and sketches, e.g.:
// SetBinding(..., (Person boundPerson) => boundPerson.Name)
// BindName helper function for use with binding to design data in Sketches.
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
cinst autohotkey.portable
cinst beyondcompare
cinst curl
module.exports = function(grunt) {
grunt.initConfig({
adminPassword: '',
solution: '',
versionNumber: grunt.option('versionNumber'),
buildAgent: grunt.option('buildAgent'),