| gitflow | git |
|---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
This file contains hidden or 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
| namespace ConsoleApplication1 | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Net; | |
| using System.Security.Principal; | |
| using Microsoft.Owin.Hosting; | |
| using Nancy; | |
| using Owin; |
Find it here: https://github.com/bitemyapp/learnhaskell
This file contains hidden or 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
Show hidden characters
| [ | |
| { | |
| "keys": ["ctrl+2"], | |
| "command": "run_macro_file", | |
| "args": { | |
| "file": "Packages/User/to-2.sublime-macro" | |
| } | |
| }, | |
| { | |
| "keys": ["ctrl+4"], |
This file contains hidden or 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 class is made available under the Apache License, Version 2.0. | |
| * | |
| * See http://www.apache.org/licenses/LICENSE-2.0.txt | |
| * | |
| * Author: Mark Lee | |
| * | |
| * (C)2013 Caprica Software (http://www.capricasoftware.co.uk) | |
| */ |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
- /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
- /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
- /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
- /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
This file contains hidden or 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
| // say we are in a function and like to encapsulate some logic easily, then return a typed object | |
| // we can do that with anonymous object: | |
| // (you cannot return anonymous type from a Func without the helpers afaik) | |
| // also worth noting: anonymous types are immutable | |
| var returnNamedTuples = Fn.Invoke(()=>{ | |
| var value = 123; | |
| var isHigh = value>100; | |
| return new {value,isHigh}; |
This file contains hidden or 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
| protected override void RequestStartup(ILifetimeScope requestContainer, IPipelines pipelines, NancyContext context) | |
| { | |
| pipelines.OnError.AddItemToEndOfPipeline((z, a) => | |
| { | |
| log.Error("Unhandled error on request: " + context.Request.Url + " : " + a.Message, a); | |
| return ErrorResponse.FromException(a); | |
| }); | |
| base.RequestStartup(requestContainer, pipelines, context); | |
| } |
This file contains hidden or 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
| /** | |
| * A monad to abstract dependencies in the code, see https://coderwall.com/p/kh_z5g | |
| */ | |
| object Reader { | |
| /** | |
| * an implicit to convert a function A => B in a Reader[A, B] | |
| */ | |
| implicit def reader[C, R](block: C => R): Reader[C, R] = Reader(block) |
This file contains hidden or 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
| case class ReaderWriterStateT[R, W, S, F[_], A]( | |
| run: (R, S) => F[(W, A, S)] | |
| ) { | |
| def map[B](f: A => B)(implicit F: Functor[F]) | |
| : ReaderWriterStateT[R, W, S, F, B] = | |
| ReaderWriterStateT { | |
| case (r, s) => F.map(run(r, s)) { | |
| case (w, a, s) => (w, f(a), s) | |
| } | |
| } |