Skip to content

Instantly share code, notes, and snippets.

import { Model, find, findAll } from 'react-jsonapi';
class User extends Model {
name: string;
email: string;
createdAt: Date;
}
diff --git a/js/package-lock.json b/js/package-lock.json
index c7e69a51..eee92809 100644
--- a/js/package-lock.json
+++ b/js/package-lock.json
@@ -3375,24 +3375,24 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
- "resolved": "",
+ "resolved": false,

use a state managmer for storing data

Redux or MobX

use react eslint

most important rules that I can think of:

  • react/jsx-no-bind (it gonna bost performance to another level)
  • react/prefer-stateless-function (for performance)
@sijad
sijad / sql-functions.txt
Created March 12, 2018 19:39
list of sql functions
ABBREV
ABORT
ABS
ACOS
ADDDATE
ADDMONTHS
ADDTIME
ADD_MONTHS
ADMINPACK
ADVISORYLOCK
@sijad
sijad / Instance Metadata.md
Created March 3, 2018 12:37 — forked from rohan-molloy/Instance Metadata.md
Instance Metadata

Cloud metadata

Many cloud providers such as Amazon AWS, Digitalocean and Vultr provide an instance metadata service.

Guest instances can discover their own parameters by accessing an API. By convention, this API is accessible from the address 169.254.169.254

To get the value of key 'k', we send an HTTP request to the relative location /$k If the key corresponds to a tuple, the request is rewritten to key/ which is an index. If no value or tuple exists, it simply returns not found

<?php
if(!class_exists("UniversalPOPGadget")) {
class UniversalPOPGadget {
private function logEvent($event) {
file_put_contents('UniversalPOPGadget.txt', $event . "\r\n", FILE_APPEND);
}
public function __construct() { $this->logEvent('UniversalPOPGadget::__construct()'); }
public function __destruct() { $this->logEvent('UniversalPOPGadget::__destruct()'); }
public function __call($name, $args) {
max-concurrent-downloads=20
continue=true
max-connection-per-server=16
min-split-size=10M
split=10
max-overall-download-limit=0
max-download-limit=0
#download path
dir=/Users/sijad/Downloads
@sijad
sijad / .tmux.conf
Last active January 23, 2022 15:53
Terminal
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal screen-256color
set -g status-keys vi
@sijad
sijad / exercis.fish
Created April 2, 2017 19:56
having fun with exercises suitable for small places
#!/usr/bin/env fish
# it's based on https://www.reddit.com/r/Fitness/comments/2t1su3/does_anyone_jump_rope_in_their_small_apartment/cnv6way/
set -l exercis_time 60
set -l exercis_circles 5
set -l exercises "mountain climbers" "push ups" "crunches" "bodyweight squats" "Now rest for $exercis_time seconds!"
set -l sleep_exercis_time (math $exercis_time + 5)
for _ in (seq 1 $exercis_circles)
@sijad
sijad / fisherman-ls.txt
Created April 1, 2017 23:16
`fisherman ls` output
$ fisher ls | awk '{print $1}'
imajes
await
bang-bang
fnm
get_file_age
getopts
gitignore
last_job_id
menu