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 Memoize: | |
def __init__(self, func): | |
self.prevs = {} | |
self.func = func | |
def __call__(self, *args): | |
if not args in self.prevs: | |
self.prevs[args] = self.func(*args) | |
return self.prevs[args] |
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
func BitsN(n int64) []int64 { | |
var bits []int64 | |
bits = make([]int64, 0) | |
for { | |
if n == 0 { | |
return bits | |
} | |
bits = append(bits, n % 2) | |
n >>= 1 |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: backend-service | |
spec: | |
selector: | |
app: backend | |
color: blue | |
type: NodePort | |
ports: |
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 SomeWidget extends StatefulWidget": { | |
"scope": "dart", | |
"prefix": "sfw", | |
"body": [ | |
"class ${1:name} extends StatefulWidget {", | |
"\t const ${1}({ Key key }) : super(key: key);", | |
"", | |
"\t@override", | |
"\t_${1}State createState() => _${1}State();", |
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
{ | |
"editor.fontWeight": "400", | |
"workbench.iconTheme": "vs-seti", | |
"editor.rulers": [80, 100], | |
"editor.minimap.enabled": false, | |
"editor.fontLigatures": true, | |
"explorer.openEditors.visible": 0, | |
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
"terminal.integrated.shellArgs.windows": [ | |
"--init-file", |
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
{ | |
"linters": { | |
"*.js": [ | |
"eslint" | |
], | |
"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|mdx|graphql|vue)": [ | |
"prettier --write", | |
"git add" | |
] | |
} |
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
{ | |
"arrowParens": "always", | |
"tabWidth": 2, | |
"singleQuote": false, | |
"semi": false, | |
"useTabs": false, | |
"printWidth": 80 | |
} |
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
node_modules/** |
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
node_modules/** |
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
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true, | |
"jest": true | |
}, | |
"parser": "babel-eslint", | |
"extends": "eslint:recommended", | |
"parserOptions": { |
OlderNewer