See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
package microui_sdl | |
import "core:fmt" | |
import "core:c/libc" | |
import SDL "vendor:sdl2" | |
import mu "vendor:microui" | |
state := struct { | |
mu_ctx: mu.Context, | |
log_buf: [1<<16]byte, |
#include <iostream> | |
#include <variant> | |
#include <vector> | |
// Forward Declaration | |
struct Node; | |
// Simple | |
using Int = int; | |
using String = std::string; |
const buildQueryParams = (params) => ( | |
Object | |
.keys(params) | |
.reduce((q, k) => q + `${k}=${params[k]}&`, '?') | |
.slice(0, -1) | |
); | |
// Usage: | |
const queryParams = buildQueryParams({ | |
hello: 'world', |
#This was done by some tool, don't know which one, and our custom built app captured theese URL's, after filtering | |
#for unique URL's, here is list of URL's in original form, I will later try to create some protection | |
/3B1728A10D221805D2CABE58B095D353.php | |
/manager/html | |
/wp-content/plugins/portable-phpmyadmin/wp-pma-mod/index.php | |
/mysql/mysqlmanager/index.php | |
/mysql/sqlmanager/index.php | |
/mysql/dbadmin/index.php | |
/mysql/admin/index.php | |
/phpmy/index.php |
// A common redux pattern when dealing with async functions is to use thunk. | |
// This usually means your action returns a new function instead of an action object, | |
// and the thunk middleware will make it all work. Example: | |
const asyncAction = () => dispatch => setTimeout(() => dispatch(someOtherAction()), 10000); | |
// Now: maybe that async stuff going on is calling some API which you don't want to overload | |
// with request, and that's what debounce is for. | |
// This is an example of a debounced function which will only be calleable once every second. | |
import { debounce } from 'lodash'; | |
const debouncedFn = debounce(() => callApi(), 1000, { leading: true, trailing: false }); |
def p_block_if_statement(t): | |
'''block_if_statement : RULE_OPEN IF data RULE_CLOSE statements else_blocks''' | |
t[0] = _AstNode(Interpreter.r_if, t[3], t[5], t[6]) | |
def p_else_if_blocks(t): | |
'''else_blocks : else_if_block | |
| else_block | |
| RULE_OPEN END RULE_CLOSE''' | |
t[0] = t[1] |