Community
Cheatsheets
- GenServer Cheatsheet by Benjamin Tan Wei Hao
Books
Community
Cheatsheets
Books
// Different ways to read/write input in Golang: | |
// ----------HackerRank---------- | |
// read from 3 nums from command line | |
package main | |
import "fmt" | |
func main() { | |
var n int | |
var a int |
Picking the right architecture = Picking the right battles + Managing trade-offs
# Not working yet | |
# a = [1, 5, 2, -2] | |
# s = [-1, 1, -1, 1] | |
# summation | |
def val(a, s) | |
sum = 0 | |
a.size.times do |i| | |
sum += a[i] * s[i] | |
end |
class Example12 { | |
public static void permutation(String str) { | |
permutation(str, ""); | |
} | |
public static void permutation(String str, String prefix) { | |
if (str.length() == 0) { | |
System.out.println(prefix); | |
} else { | |
for (int i = 0; i < str.length(); i++) { |
First of all, please note that token expiration and revoking are two different things.
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.
Quoted from JWT RFC:
const myfunc = (add1, add2) => { | |
return new Promise((resolve, reject) => { | |
const new_value = add1 + add2; | |
setTimeout(() => { | |
resolve(new_value); | |
}, 3000); | |
}) | |
}; | |
myfunc(1, 5) |
{ | |
"sublimeTextKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "alt", | |
"editor.snippetSuggestions": "top", | |
"editor.formatOnPaste": true, | |
"editor.minimap.enabled": false, | |
"editor.wordWrap": "on", | |
"editor.tabSize": 2, | |
"files.insertFinalNewline": true, | |
"files.trimTrailingWhitespace": true, |
<!doctype HTML> | |
<html> | |
<script src="aframe.min.js"></script> | |
<script src="aframe-ar-modified.js"> </script> | |
<body style='margin : 0px; overflow: hidden;'> | |
<a-scene embedded arjs> | |
<a-marker-camera preset='custom' type='pattern' url='pattern-marker.patt'> | |
<a-box position='0 0.5 0' material='color: red; opacity: 0.5;'></a-box> | |
</a-marker-camera> | |
<a-entity camera></a-entity> |