Skip to content

Instantly share code, notes, and snippets.

View KSXGitHub's full-sized avatar
🏠
Working from home

Khải KSXGitHub

🏠
Working from home
  • Earth, Solar System, Orion Arm, Milky Way
  • X @hvksmr1996
View GitHub Profile
const {catelogueNameValidation, activeStatusValidation} = formValidation
if (catelogueNameValidation || activeStatusValidation) return // Seriously, don't ever use 'null'
switch (submitType) {
case 'add':
this.props.postCatalogues(catelogue)
break
case 'edit':
this.props.updateCatalogues(_id, catalogue)
😈 👿 🐈 🐱 🐕 🐶
@KSXGitHub
KSXGitHub / calendar.md
Last active December 11, 2017 08:20
Lịch thi

Screenshot

parser: babel-eslint
parserOptions:
ecmaVersion: 7
sourceType: module
ecmaFeatures:
impliedStrict: true
experimentalObjectRestSpread: true
env:
es6: true
extends:
@KSXGitHub
KSXGitHub / extensions
Created December 4, 2017 06:50
My VS Code extensions
Extensions Added:
advanced-new-file v0.5.1
apacheconf-snippets v1.1.9
aspnet-helper v0.6.4
atom-keybindings v3.0.2
atom-material-theme v1.2.2
auto-close-tag v0.5.5
auto-rename-tag v0.0.15
azure-account v0.2.2

Alternate Solutions

Use let

for (let i = 0; i <= 4; i++) {
  setTimeout(() => console.log(i), 0)
}
<?php
class DeclarativeExample {
private $data;
public function __construct(array $data) {
$this->data = $data;
}
public function get(string $key) {
return $data[$key];
@KSXGitHub
KSXGitHub / settings.json
Created November 9, 2017 12:34
VS Code settings
{
"workbench.colorTheme": "Material",
"editor.fontFamily": "consolas",
"editor.tabSize": 2,
"terminal.integrated.fontFamily": "consolas",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.env.linux": {
"TERMINAL_NAME": "vscode",
"OPERATING_SYSTEM": "linux",
"ZSH_THEME": "amuse"
@KSXGitHub
KSXGitHub / status-to-message.php
Last active November 8, 2017 07:04 — forked from henriquemoody/http-status-codes.php
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
return array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // WebDAV; RFC 2518
200 => 'OK',
@KSXGitHub
KSXGitHub / code-snippet-without-syntax-error.php
Last active November 6, 2017 08:32
To help an idiot who doesn't know how to write code correctly
<?php
class up {
private $mang;
public function __construct(array $mang = array()) {
$this->mang = $mang;
}
private function khoitao() { // WHAT THE FUCK IS THIS SHIT?
$this->mang[0] = 'a'; // SERIOUSLY, WHAT THE FUCK!!