View urlsort.ml
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
let split_domain = String.split_on_char '.';; | |
let url_re = | |
Str.regexp "^\\([^:]*://\\)?\\([^/]*\\)\\(/[^?]*\\)?\\(\\?.*\\)?$";; | |
let split_url x = | |
let protocol, domain, path, query = | |
if Str.string_match url_re x 0 then ( | |
let protocol = try Str.matched_group 1 x with Not_found -> "" in | |
let domain = Str.matched_group 2 x in |
View c-bits-byteswap.adb
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
-- This file is translated by "headmaster" version 0.31-1157199 (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
package body C.bits.byteswap is | |
function bswap_32 (bsx : unsigned_int) return unsigned_int is | |
begin | |
return builtin_bswap32 (bsx); | |
end bswap_32; |
View c-asm_generic-errno.ads
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
-- This file is translated by "headmaster" version 0.31-1157199 (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
package C.asm_generic.errno is | |
pragma Preelaborate; | |
EADDRINUSE : constant := 98; | |
EADDRNOTAVAIL : constant := 99; | |
EADV : constant := 68; |
View c-alloca.ads
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
-- This file is translated by "headmaster" version 0.31-1157199 (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
with C.stddef; | |
package C.alloca is | |
pragma Preelaborate; | |
function alloca (size : stddef.size_t) return void_ptr; | |
pragma Import (C, alloca, "alloca"); |
View c-bits-byteswap.adb
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
-- This file is translated by "headmaster" version 0.30-e83b81d (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
package body C.bits.byteswap is | |
function bswap_32 (bsx : unsigned_int) return unsigned_int is | |
begin | |
return builtin_bswap32 (bsx); | |
end bswap_32; |
View c-bits-mman.ads
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
-- This file is translated by "headmaster" version 0.30-e83b81d (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
package C.bits.mman is | |
pragma Preelaborate; | |
MAP_32BIT : constant := 64; | |
MAP_DENYWRITE : constant := 2048; | |
MAP_EXECUTABLE : constant := 4096; |
View c-alloca.ads
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
-- This file is translated by "headmaster" version 0.30-e83b81d (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
with C.stddef; | |
package C.alloca is | |
pragma Preelaborate; | |
function alloca (size : stddef.size_t) return void_ptr; | |
pragma Import (C, alloca, "alloca"); |
View c-alloca.ads
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
-- This file is translated by "headmaster" version 0.30-e83b81d (devel). | |
-- The original C header's license should be applied to this file. | |
-- All conditional-directives are expanded for the exclusive use of your | |
-- environment, it is not recommended to commit this file to any repository. | |
------------------------------------------------------------------------------- | |
with C.stddef; | |
package C.alloca is | |
pragma Preelaborate; | |
function alloca (size : stddef.size_t) return void_ptr; | |
pragma Import (C, alloca, "alloca"); |
View magicmoduletype.ml
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
module type T1 = sig | |
type t (* any abstract type *) | |
val one: t | |
end;; | |
module M1: T1 = Int;; | |
type 'a repr = C1: M1.t repr (* GADT is needed *) | |
let one: string = |
View bing-daily-wallpaper
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
#!/bin/bash | |
# Thanks to https://ubuntuforums.org/showthread.php?t=2074098 | |
[[ -z "$HOME" ]] && exit 1 | |
[[ -z "$TMPDIR" ]] && exit 1 | |
# $bing is needed to form the fully qualified URL for | |
# the Bing pic of the day | |
bing="www.bing.com" |
NewerOlder