- Download the perforce visual tool suite from here: http://www.perforce.com/perforce/downloads/index.html
- Copy only the p4merge.app file into your /Applications/ directory
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
scala> trait Assoc[K] { type V ; val value: V } | |
defined trait Assoc | |
scala> def mkAssoc[V0](k: String, v: V0): Assoc[k.type] { type V = V0 } = | |
| new Assoc[k.type] { type V = V0 ; val value = v } | |
mkAssoc: [V0](k: String, v: V0)Assoc[k.type]{type V = V0} | |
scala> implicit def nameAssoc = mkAssoc("Name", "Mary") | |
nameAssoc: Assoc[String("Name")]{type V = String} |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Text.RegularExpressions; | |
namespace SemiIdeomaticParsers | |
{ | |
public delegate Tuple<T, string> Parser<T>(string value); |
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
create an alias git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
git lg
git lg -p
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
public static void MappingExample() | |
{ | |
var averages = Html | |
.Download("http://github.com") | |
.Select(html => { | |
var links = Html.ParseLinks(html); | |
var averageLength = links.Average(x => x.Length); | |
return String.Format("{0} links found, average length is {1}", links.Count, averageLength); | |
}); |
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
//already defined in F# base library, but I wanted to show how simple it is | |
let (|>) a f = f a | |
let latestRequest = | |
user | |
|> login | |
|> clickMenu "Forms" | |
|> waitPageLoad | |
|> openFilter ["Communication"; "Request"] | |
|> results |
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
namespace Topshelf | |
[<AutoOpen>] | |
module Topshelf = | |
open System | |
open Topshelf.HostConfigurators | |
open Topshelf.Runtime | |
let configureTopShelf f = |
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
{-# LANGUAGE TypeFamilies #-} | |
import Data.Function (on) | |
import Control.Applicative | |
data EventData e = EventData { | |
eventId :: Int, | |
body :: Event e | |
} |
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
--- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300 | |
+++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200 | |
@@ -695,7 +695,9 @@ | |
/* It is very rare that the developer ever has full control of stdin, | |
so any use of gets warrants an unconditional warning. Assume it is | |
always declared, since it is required by C89. */ | |
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); | |
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) | |
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); | |
+#endif |