Skip to content

Instantly share code, notes, and snippets.

View abel0b's full-sized avatar
🐉
Compiling

Abel Calluaud abel0b

🐉
Compiling
  • Voie lactée
View GitHub Profile
function (request, response, next) {
let html = ReactDOMServer.renderToString(React.createElement(
StaticRouter,
{
location: request.url,
context: {}
},
React.createElement(App)
));
response.send(`
@abel0b
abel0b / server.js
Created June 17, 2018 18:27
express api
import express from "express"
import ArticleController from "controller/ArticleController"
const app = express()
app.get("/articles", ArticleController.index)
app.get("/articles/create", ArticleController.create)
app.get("/articles/:slug", ArticleController.show)
app.get("/articles/:slug/edit", ArticleController.edit)
app.patch("/articles/:slug", ArticleController.update)
@abel0b
abel0b / lab_coverage_regex.txt
Created August 17, 2018 08:51
lab test framework test coverage parsing with regex
# in gitlab Settings > CI/CD > General pipelines > Test coverage parsing
/Coverage: (\d+\.\d+)% \(\d+\/\d+\)/
async function call(method, path, body) {
const response = await fetch(apiRoot + path, {
method,
body
})
return response
}
@abel0b
abel0b / network.sh
Created December 21, 2019 13:04
Networking commands
# Show all hosts in lan
arp -n
# Show hostname
nslookup xxx.xxx.xxx.xxx
@abel0b
abel0b / expand_home.sh
Created December 27, 2019 14:59
Expand ~ in path
function expand_home() {
echo "${1/#\~/$HOME}"
}
@abel0b
abel0b / timer.sh
Created December 29, 2019 14:34
Measure time in millisecond in bash
start=$(date +%s%3N)
sleep 42
end=$(date +%s%3N)
echo done in $((end-start))ms
@abel0b
abel0b / version.sh
Created December 31, 2019 10:32
Git version number
echo $(git rev-list --all --count).$(git rev-parse --short HEAD)$([[ -z "$(git status --porcelain --untracked-files=no)" ]] || echo "+")
@abel0b
abel0b / keybase.md
Created January 8, 2020 19:25
Keybase proof

Keybase proof

I hereby claim:

  • I am abel0b on github.
  • I am abel0b (https://keybase.io/abel0b) on keybase.
  • I have a public key whose fingerprint is 9314 D1AD B327 B2D3 EA8C D38A 3BE0 2A92 7CB2 7ACC

To claim this, I am signing this object:

@abel0b
abel0b / hardware.md
Last active January 11, 2020 11:01
Check hardware information on linux
cat /proc/cpuinfo

Get number of cores

grep "cpu cores" /proc/cpuinfo

Get cpu topology