This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"os" | |
"os/exec" | |
"regexp" | |
"strconv" | |
) |
This file contains hidden or 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
package main | |
import ( | |
"encoding/binary" | |
"fmt" | |
"io" | |
"net/http" | |
"net/url" | |
"os" | |
"regexp" |
This file contains hidden or 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
on GetApplicationCorrespondingToProcess(process_name) | |
tell application "System Events" | |
set application_file to file of (application processes where name is process_name) | |
end tell | |
return application_file as string | |
end GetApplicationCorrespondingToProcess | |
repeat | |
tell application "System Events" |
This file contains hidden or 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
[package] | |
name = "rs-bankers" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
tokio = { version = "1.21.0", features = ["full"] } | |
tokio-scoped = "0.2.0" |
This file contains hidden or 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
package main | |
func max(x, y int) int { | |
if x < y { | |
return y | |
} | |
return x | |
} | |
type Node struct { |
This file contains hidden or 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
<script> | |
async function run() { | |
let res = 0; | |
for (let i = 0; i < 3; i++) { | |
const response = await fetch('https://jsonplaceholder.typicode.com/todos/1'); | |
const json = await response.json(); | |
res += json.id; | |
} | |
console.log(res); | |
} |
This file contains hidden or 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
# Solution by Alain Gilbert | |
# http://letsrevolutionizetesting.com/challenge | |
curl -s http://letsrevolutionizetesting.com/challenge.json > tmp.json | |
while grep --quiet "follow" tmp.json; do | |
sed "s/challenge/challenge.json/g" tmp.json > tmp1.json | |
curl -s $(cat tmp1.json | jq -r '.follow') > tmp.json | |
done | |
cat tmp.json | jq -r '.message' | |
rm tmp.json tmp1.json |
This file contains hidden or 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
// Key bindings user: | |
{ "keys": ["alt+super+r"], "command": "refresh_namespaces_in_repl"}, |
This file contains hidden or 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
import re | |
import sublime | |
import sublime_plugin | |
import SublimeREPL.sublimerepl | |
import SublimeREPL.text_transfer | |
class RefreshNamespacesInReplCommand(SublimeREPL.text_transfer.ReplTransferCurrent): | |
def run(self, edit): | |
ns = re.sub("ns\s*", "", self.view.substr(self.view.find("ns\s*\S+",0))) | |
text = "(require '%s :reload)" % ns |
This file contains hidden or 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
# Solution by Alain Gilbert | |
# http://www.vessel.com/careers | |
while grep "eval(" apply.rb > /dev/null; do | |
sed "s/eval/puts/g" apply.rb > 'tmp.rb'; | |
ruby tmp.rb > 'apply.rb'; | |
done | |
cat apply.rb |
NewerOlder