Skip to content

Instantly share code, notes, and snippets.

@proclaim
proclaim / reset-vs-code-cmd-linux
Created September 28, 2022 02:00
Factory Reset VS Code for Linux
rm -rf "$HOME/.vscode"
rm -rf "$HOME/.config/Code"
@proclaim
proclaim / reset-vs-code-cmd-windows.sh
Created September 28, 2022 01:58
Factory Reset VS Code for Windows
rm -r "$env:APPDATA\Code"
rm -r "$env:USERPROFILE\.vscode"
@proclaim
proclaim / reset-vs-code-cmd-mac.sh
Created September 28, 2022 01:55
Factory Reset VS Code for Mac
rm -rf "$HOME/.vscode"
rm -rf "$HOME/Library/Application Support/Code"
rm -rf "$HOME/Library/Caches/com.microsoft.VSCode"
rm -rf "$HOME/Library/Saved Application State/com.microsoft.VSCode.savedState"
@proclaim
proclaim / docker-compose.yaml
Created November 2, 2021 14:49
MySQL docker compose file
version: '3.1'
services:
mysql:
image: mysql:latest
container_name: mysql
# this is the maigc for login
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_DATABASE: 'db'
package service
import (
"testing"
"github.com/proclaim/mock-slack-api/server"
"github.com/slack-go/slack"
"github.com/stretchr/testify/assert"
)
package service
import (
"github.com/slack-go/slack"
)
func (s *SlackService) PostMessage(channel string, attachment slack.Attachment) (string, string, error) {
// ... your implementation here
return s.api.PostMessage(
channel,
package server
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"strings"
@proclaim
proclaim / typeorm-delete-multiple.js
Last active June 7, 2021 04:24
typeorm delete multiple records
// assume entityIds is an array
connection.createQueryBuilder()
.delete()
.from(entity)
.where('entity.id IN (:...ids)', { ids: entityIds })
.execute()
@proclaim
proclaim / pull-files.sh
Created February 21, 2019 16:13
Pull Files Out From Subdirectories
num=1
find . -mindepth 2 -type f -print | while read x; do
y=$(basename "$x")
if [ -f "$y" ]; then
mv "$y" "$num"."$y"
num=$(( $num + 1 ))
fi
mv "$x" "$y"
done
@proclaim
proclaim / deploy.yml
Created November 14, 2018 03:08
ansible for deploying to aws lambda
---
- hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create Lambda function
lambda:
name: hello-Taiwan
region: us-east-1
zip_file: "main.zip"