Skip to content

Instantly share code, notes, and snippets.

@schmunk42
schmunk42 / git-changelog-markdown.sh
Last active June 5, 2019 13:32
Bash git changelog draft function
# Usage: git-changelog-markdown > changelog-draft.md
git-changelog-markdown () {
git log --topo-order --pretty="format:%d - %s" | sed 's/(tag.*) /\
### & \
/' \
| grep -v 'Merge pull request' \
| grep -v 'Merge commit'
}
@Nachtalb
Nachtalb / telegram-desktop-multiple-accounts.rst
Last active June 25, 2024 04:10
Add multiple accounts in Telegram Desktop [Linux | MacOSX | Windows]
@mauricedb
mauricedb / Subject under test
Last active December 7, 2023 14:46
Testing stateful React hooks
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}
@Hammster
Hammster / crypto-pbkdf2-example.js
Last active September 2, 2020 12:48 — forked from skeggse/crypto-pbkdf2-example.js
Updated Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
const crypto = require('crypto')
// larger numbers mean better security, less
const config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// A selected HMAC digest algorithm specified by digest is applied to derive
@moemoe89
moemoe89 / .gitlab-ci.yml
Created May 2, 2017 03:13
Example Gitlab CI Setup for Go-Lang
image: golang:1.8.1
variables:
BIN_NAME: go-practice-ci
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/go-practice-ci
stages:
- build
- test
@bruce
bruce / Login.js
Last active August 5, 2021 16:25
React + Redux + localStorage Login example
// components/Login/Login.js
class Login extends Component {
// ...
handleSubmit(evt) {
evt.preventDefault();
this.props.mutate(this.state)
.then(({ data }) => {
@jcloutz
jcloutz / .golang-example-gitlab-ci.yml
Last active December 6, 2022 11:20
Example Gitlab CI setup for Go using the official golang docker image
image: golang:1.7
stages:
- build
- test
before_script:
- go get github.com/tools/godep
- cp -r /builds/user /go/src/github.com/user/
- cd /go/src/github.com/user/repo
@itod
itod / split_keyboards.md
Last active June 12, 2024 12:08
Every "split" mechanical keyboard currently being sold that I know of
@nagelflorian
nagelflorian / buckets.tf
Last active February 12, 2024 07:44
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@obenjiro
obenjiro / vscode-pluggins.txt
Last active April 1, 2021 16:42
vscode-pluggins
code --install-extension Angular.ng-template
code --install-extension Compulim.vscode-express
code --install-extension EditorConfig.EditorConfig
code --install-extension SimonTest.simontest
code --install-extension Zignd.html-css-class-completion
code --install-extension alefragnani.project-manager
code --install-extension andys8.jest-snippets
code --install-extension burkeholland.simple-react-snippets
code --install-extension capaj.vscode-exports-autocomplete
code --install-extension ChakrounAnas.turbo-console-log