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
class Store extends EventTarget { | |
constructor(reducer, state) { | |
super() | |
this.#reducer = reducer | |
this.#state = state | |
} | |
get state() { | |
return this.#state | |
} | |
dispatch(action) { |
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
hotkey.bind({"command", "option"}, 'down', function() | |
local resizing = hs.hotkey.modal.new() | |
local activeWindow = hs.window.focusedWindow() | |
local backdrop = hs.drawing.rectangle( hs.screen.mainScreen():frame() ) | |
:setFillColor({ red=0, green=0, blue=0, alpha=0.2 }) | |
local resizeIndicator = hs.drawing.rectangle({ x=0, y=0, w=0, h=0 }) | |
:setFillColor({ red=1, green=1, blue=1, alpha=0.3 }) | |
:setStrokeWidth(1) | |
:setStroke(1) | |
:setStrokeColor({ red=1, green=1, blue=1, alpha=0.5 }) |
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
### Keybase proof | |
I hereby claim: | |
* I am keithamus on github. | |
* I am keithamus (https://keybase.io/keithamus) on keybase. | |
* I have a public key whose fingerprint is 887F 7DC5 A858 9D7D 8653 D0B7 FCCC E6EC AC15 16FC | |
To claim this, I am signing this object: |
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
<div itemscope itemtype="http://schema.org/Thing"></div> |
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
var app = require('express')(), | |
fs = require('fs'); | |
var headers = []; | |
app.get('/', function (req, res) { | |
headers.push(req.headers); | |
res.json(req.headers); | |
}); | |
setInterval(function () { | |
fs.writeFileSync('headers.json', JSON.stringify(headers)); | |
}, 10000); |
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
function hex2rgb(hex) { | |
var int = parseInt(hex.replace(/^#/, '').replace(/^#/, '').replace(/^([\da-f])([\da-f])([\da-f])$/, '$1$1$2$2$3$3'), 16); | |
return { | |
r: (int >> 16) & 255, | |
g: int >> 8 & 255, | |
b: int & 255 | |
}; | |
} |
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
define([], function () { | |
return function HypotheticalHelperMethod() { | |
doSomeOtherStuff(); | |
} | |
}); | |
define(["helperMethod"], function (helperMethod) { |
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/sh | |
message=`sed '/^#/,$d' $1` | |
firstLine=`echo "$message" | awk 'NR>1{exit};1'` | |
exitCode=0 | |
txtred=$(tput setaf 1) # Red | |
txtrst=$(tput sgr0) # Text reset | |
if [[ "`echo "$firstLine" | awk '{print length()}'`" -gt 49 ]]; then | |
echo "${txtred}[POLICY] Ensure first line in your commit message is no longer than 50 characters${txtrst}" |
NewerOlder