Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1 | |
$domain = "mydomain.com" | |
$certificiatePassword = "abcd1234" | |
$email = "[email protected]" | |
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid() | |
mkdir $vault | |
cd $vault | |
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/ | |
New-ACMERegistration -Contacts mailto:$email |
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
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers. | |
package main | |
import ( | |
"crypto/tls" | |
"flag" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"time" |
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
function copyToClipboard( text ){ | |
var copyDiv = document.createElement('div'); | |
copyDiv.contentEditable = true; | |
document.body.appendChild(copyDiv); | |
copyDiv.innerHTML = text; | |
copyDiv.unselectable = "off"; | |
copyDiv.focus(); | |
document.execCommand('SelectAll'); | |
document.execCommand("Copy", false, null); | |
document.body.removeChild(copyDiv); |
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
Convention: Byte array notation as it would appear in a hexeditor. | |
= Layout= | |
KDBX files, the keepass database files, are layout as follows: | |
1) Bytes 0-3: Primary identifier, common across all kdbx versions: | |
private static $sigByte1=[0x03,0xD9,0xA2,0x9A]; | |
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1) |
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
// General hints on defining types with constraints or invariants | |
// | |
// Just as in C#, use a private constructor | |
// and expose "factory" methods that enforce the constraints | |
// | |
// In F#, only classes can have private constructors with public members. | |
// | |
// If you want to use the record and DU types, the whole type becomes | |
// private, which means that you also need to provide: | |
// * a constructor function ("create"). |
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
module Dapper.Extensions | |
open System | |
open System.Data.SqlClient | |
open Dapper | |
let extractValue (x:obj) = | |
match x with | |
| null -> null | |
| _ -> match x.GetType().GetProperty("Value") with |
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
1 acorn: A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om. | |
8 amp: Leiningen template for AMP (Alfresco Module Package) projects. | |
1 angular-cl2: A Leiningen template for using AngularJS and ChlorineJS | |
1 angular: Clojure and AngularJS in perfect harmony. | |
6 angular: Clojure and AngularJS in perfect harmony. $ lein new angular <name> | |
2 angularjs-app: Leiningen template for web application with http-kit and angularjs | |
5 angular-simple: Clojure and AngularJS $ lein new angular-simple <name> | |
1 aperiodic-cljs: My cljs development starting point. Basically ripped from lein-cljsbuild. | |
1 apijr: clojurescript project template | |
1 appfgo: 'lein new' template for Funcgo application |
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
87 luminus: a template for creating Luminus applications | |
7 mala: A Leiningen template for Mala | |
1 maple: A leinginen template with MPL | |
3 mesos-framework: A template for setting up mesos-frameworks using component. | |
3 mies-brepl: A minimal ClojureScript project template with REPL | |
7 mies-node: A minimal ClojureScript Node.js project template | |
27 mies-om: A minimal Om project template | |
2 mies-weasel: A minimal ClojureScript project template with Weasel REPL, forked from mies. | |
40 mies: A minimal ClojureScript project template | |
3 mies: FIXME: write description |
OlderNewer