View ast.fs
module Ast | |
open System | |
type slotDeclaration= { | |
Index : int | |
Name : string | |
Size : int | |
} |
View Permutation.hs
module Permutation where | |
permutate :: [a] -> [[a]] | |
permutate [x1,x2] = [[x1,x2],[x2,x1]] | |
permutate items = concat $ map p $ getEachInFrontOnce items | |
where | |
p (x:xs) = map (\items -> [x]++items) $ permutate xs | |
getEachInFrontOnce items = map (putItemAtIndexToFront items) [0..length items-1] | |
putItemAtIndexToFront items idx = [items!!idx] ++ take idx items ++ drop (idx+1) items |
View A copy op preserving relative folder structure
$a = pwd | |
ls -r | | |
? { !$_.name.Contains(".g.") } | | |
? { $_.Extension -eq ".cs" -or $_.Extension -eq ".csproj" } | | |
? { $_.lastwritetime -gt [DateTime]::Now.AddHours(-6) } | | |
% { | |
$relative = $_.fullname.Replace($a.Path + "\","") | |
$Path = [System.IO.Path]::GetDirectoryName($relative) | |
mkdir c:\temp\$path -erroraction SilentlyContinue | |
Copy-Item -path $relative -destination c:\temp\$path |
View RelayCommand
using System; | |
using System.Windows.Input; | |
namespace Something | |
{ | |
public class RelayCommand : ICommand | |
{ | |
private readonly Func<object, bool> _canExecute; | |
private readonly Action<object> _execute; |
View HelpController.cs
using FubuMVC.Core; | |
namespace CharmSim.Controllers | |
{ | |
public class HelpController | |
{ | |
public HelpViewModel Start() | |
{ | |
return new HelpViewModel { Title = "Hello from Controller! " }; | |
} |
View tax.cs
public decimal GetTaxes(decimal salary) | |
{ | |
decimal tax = 0; | |
var progressiveTaxation = new[] { 0.1m, 0.14m, 0.23m, 0.3m, 0.33m, 0.45m }; | |
var progressionSlices = new[] { 5070 - 0, 8660 - 5070, 14070 - 8660, 21240 - 14070, 40230 - 21240, decimal.MaxValue }; | |
var progression = 0; | |
while (salary > 0) |
View zzz.ps1
function zzz { | |
$source = @" | |
[DllImport("powrprof.dll")] | |
public static extern void SetSuspendState(bool hibernate, bool forceCritical, bool disableWakeEvent); | |
"@ | |
$app = Add-Type -Namespace "Standby" -MemberDefinition $source -Name Sleep -PassThru; | |
$app::SetSuspendState($false,$true,$false); | |
} |
View Program.cs
using System; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.IO; | |
namespace DifftoolStarter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
View EntryPoint.ts
import {assign} from 'lodash' | |
function startModule() { | |
//etc. | |
} | |
global['Project'] = assign(global['Project'] || {}, { | |
startModule | |
}); |
View git achievements
- Cloned from a remote repository | |
- Initialized an empty repository | |
- Pulled from a remote repository | |
- Made first commit | |
- Pushed to a remote repository | |
- Made first local branch | |
- Pushed a new branch | |
- Added a second remote | |
- Merged a branch into another one | |
- Deleted a local branch |
OlderNewer