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 library demonstrates the difference between | |
RWST (Either String) a | |
RWS (Either String a) | |
The first form outputs | |
1 + 2, after bonus = Right (103,[]) | |
5 + 10, after bonus = Right (115,["10 is a big number"]) | |
12 + 19, after bonus = Right (131,["12 is a big number","19? I might run out of toes"]) |
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
// usage: select a range to titlecase. go to tools / script edit. run myFunction. | |
function myFunction() { | |
var selection = SpreadsheetApp.getActiveSpreadsheet().getSelection(); | |
var ranges = selection.getActiveRangeList().getRanges(); | |
for (var i = 0; i < ranges.length; i++) { | |
Logger.log('Active Ranges: ' + ranges[i].getA1Notation()); | |
var range = ranges[i]; | |
for (var y = 1; y <= range.getHeight(); y++) { | |
for (var x = 1; x <= range.getWidth(); x++) { |
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
Under 10.15.7, I woke my MacBook Pro from sleep to find the wifi constantly disconnecting and reconnecting, on a 20 second cycle. | |
I"m leaving this here in case anybody else finds it useful while troubleshooting. | |
Once it goes through, I'm gonna reboot. | |
Sun Dec 27 16:02:15.446 Apple80211Set:9543 Processing APPLE80211_IOC_ROAM | |
Sun Dec 27 16:02:15.446 Apple80211Set:9557 Processing APPLE80211_IOC_ROAM dataRef:0x7fdb05766a10 | |
Sun Dec 27 16:02:15.446 Apple80211Set:9578 CFType is CFData | |
Sun Dec 27 16:02:17.657 <kernel> postMessage::1349 APPLE80211_M_BSSID_CHANGED received |
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
#!stack | |
-- stack --resolver lts-15.12 script | |
{-# LANGUAGE MultiWayIf #-} | |
import Data.List (isPrefixOf) | |
data Person = Person { pname :: String, children :: [Person], income :: Float } | |
a = Person "Alice" [] 8000 | |
b = Person "Bob" [] 2000 |
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
#!stack | |
-- stack --resolver lts-15.12 script | |
import Data.List (isPrefixOf) | |
data Person = Person { pname :: String, children :: [Person] } | |
a = Person "Alice" [] | |
b = Person "Bob" [] | |
c = Person "Carol" [a, b] |
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
#!stack | |
-- stack --resolver lts-15.12 script | |
data Person = Person { pname :: String, children :: [Person] } | |
a = Person "Alice" [] | |
b = Person "Bob" [] | |
c = Person "Carol" [a, b] | |
data TaxCredit = TaxCredit { tcname :: 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
#!stack | |
-- stack --resolver lts-15.12 script | |
data Person = Person { pname :: String, children :: [Person] } | |
a = Person "Alice" [] | |
b = Person "Bob" [] | |
c = Person "Carol" [a, b] | |
data TaxCredit = TaxCredit { tcname :: String, rate :: Person -> Int } |
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
#!/opt/local/bin/python | |
# https://twitter.com/mengwong/status/1271434036976603136 | |
from abc import ABC, abstractmethod | |
class Person: | |
def __init__(self, children=[]): | |
self.children = children |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:camunda="http://camunda.org/schema/1.0/dmn" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" id="definitions_0t62h4q" name="SG's Resilience & Solidarity Budget" namespace="http://camunda.org/schema/1.0/dmn" exporter="dmn-js (https://demo.bpmn.io/dmn)" exporterVersion="8.2.0"> | |
<decision id="decision_13ddh8x" name="Wealth-Based"> | |
<informationRequirement id="InformationRequirement_0gmit98"> | |
<requiredInput href="#InputData_0l1r2fx" /> | |
</informationRequirement> | |
<informationRequirement id="InformationRequirement_0p71qyg"> | |
<requiredInput href="#InputData_06zht3h" /> | |
</informationRequirement> | |
<decisionTable id="decisionTable_0b71773"> |
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
The primary goal is to swap command and option. | |
The secondary goal is to remap Caps Lock to Control. | |
The tertiary goal is to share modifier keys across keyboards, so you can emacs with two keyboards. | |
The following instructions are good as of 2016-08-24, for OS X El Capitan 10.11.6. | |
Mac OS Sierra broke Seil support; Seil instructs us to consider Karabiner Elements. | |
But when Karabiner Elements swaps command and option, it does it for all keyboards; | |
meaning the native keyboard also gets its command and option swapped, which is bad! |
NewerOlder