Skip to content

Instantly share code, notes, and snippets.

@qwhex
qwhex / role_management.md
Last active September 28, 2023 13:23
Role management

Role management

Roles

Admin

Admin is a special "role". There's only one Admin on MakeMyStrategy. Admin has special permissions:

  • Switch between every organization
  • Access and edit any strategy

PHP 7.0

  • Scalar type declarations: Allows functions to require certain types of arguments.
    function sum(int $a, int $b) {
        return $a + $b;
    }
  • Return type declarations: Allows functions to declare the type of the return value.
    function sum($a, $b): int {
@qwhex
qwhex / settings.json
Created February 9, 2021 12:02
.vscode/settings.json
// Install this extension:
// https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
{
// No default format on save
"editor.formatOnSave": false,
"css.validate": false,
"less.validate": false,
"scss.validate": false,

Keybase proof

I hereby claim:

  • I am qwhex on github.
  • I am mice (https://keybase.io/mice) on keybase.
  • I have a public key ASCGY-DJM1KSA8DIVvP0vI6c3T5DJORu0nk0Y9Z9kx8r4Qo

To claim this, I am signing this object:

@qwhex
qwhex / array_comprehension.php
Created December 9, 2016 00:07
PHP array comprehension like Python list comprehensions
<?php
array_map(function($x) {return $x*$x;}, range(0, 9))
@qwhex
qwhex / ordered_dictwriter.py
Created December 8, 2016 04:46
Functional csv.DictWriter example where columns keep the original order
#!/usr/bin/env python3
# Functional csv.DictWriter example where columns keep the original order
import csv
def gen_rows(input_path):
with open(input_path) as input_file:
reader = csv.DictReader(input_file)
@qwhex
qwhex / 0_reuse_code.js
Created March 2, 2016 14:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console