Skip to content

Instantly share code, notes, and snippets.

View slimlime's full-sized avatar
😀
Hello, welcome to Weiber.

slimlime

😀
Hello, welcome to Weiber.
  • Australia
View GitHub Profile
@slimlime
slimlime / getUserData.js
Created August 3, 2020 07:48 — forked from shark-h/getUserData.js
Get user data from Firebase
const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
// On sign up.
exports.processSignUp = functions.auth.user().onCreate(user => {
const customClaims = {
"https://hasura.io/jwt/claims": {
"x-hasura-default-role": "user",
"x-hasura-allowed-roles": ["user"],
@slimlime
slimlime / git bash ssh agent.md
Created July 28, 2020 22:34 — forked from Peregrinox/git bash ssh agent.md
configure your git bash to run agent on start
@slimlime
slimlime / TestTypedForms.ts
Created July 22, 2020 04:56 — forked from dmorosinotto/TestTypedForms.ts
Typed @angular/forms FIXED set/patchValue - strict all the way down ^_^
import { FormGroup, FormControl, FormArray, Validators } from "@angular/forms";
function testFormGroupTyped() {
var frm = new FormGroup({
a: new FormArray([new FormControl(0)]),
b: new FormControl(true),
c: new FormGroup({
s: new FormControl("abc"),
n: new FormControl(123)
})
@slimlime
slimlime / .zshrc
Created July 15, 2020 05:17 — forked from pgarciacamou/.zshrc
Use `.gitemail` and `.npmregistry` files to switch user per project.
# Automatically assign local git user email
# This code expects the following
# file ".gitemail" to exist and contain only 1 row with an email
# file ".npmregistry" to exist and contain only 1 row with the registry url
#
# Note: if any of the files don't exist then the default will be used
setup-dev-user() {
local expected_git_email=$(grep -hs ^ ./.gitemail)
local current_git_email="$(git config user.email)"
local default_git_email="[email protected]"
@slimlime
slimlime / .zshrc
Created July 15, 2020 05:17 — forked from pgarciacamou/.zshrc
Use `.gitemail` and `.npmregistry` files to switch user per project.
# Automatically assign local git user email
# This code expects the following
# file ".gitemail" to exist and contain only 1 row with an email
# file ".npmregistry" to exist and contain only 1 row with the registry url
#
# Note: if any of the files don't exist then the default will be used
setup-dev-user() {
local expected_git_email=$(grep -hs ^ ./.gitemail)
local current_git_email="$(git config user.email)"
local default_git_email="[email protected]"
@slimlime
slimlime / 1-setup.md
Created July 13, 2019 09:32 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
-b 4096 bit size
-a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking)
-C "[email protected]" comment..
@slimlime
slimlime / .swiftlint.yml
Created February 6, 2019 08:39 — forked from candostdagdeviren/.swiftlint.yml
Sample SwiftLint file to apply best practices
disabled_rules: # rule identifiers to exclude from running
- variable_name
- nesting
- function_parameter_count
opt_in_rules: # some rules are only opt-in
- control_statement
- empty_count
- trailing_newline
- colon
- comma
@slimlime
slimlime / Swift4_JSON_09.swift
Created December 17, 2018 05:58 — forked from magicien/Swift4_JSON_09.swift
How should I inherit Codable class?
import Foundation
let json = """
{
"a": 1,
"b": 2,
"c": 3
}
""".data(using: .utf8)!
import Foundation
// framework側のコード
let ExtensionKey = CodingUserInfoKey(rawValue: "extensionKey")!
struct Group: Codable {
let users: [User]
}