Skip to content

Instantly share code, notes, and snippets.

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

Theo shierro

🏠
Working from home
View GitHub Profile
@hucancode
hucancode / README.md
Last active January 18, 2024 03:57
Flatten Strapi 4's response JSON

Update 29/11/2022

There is a plugin on Strapi Marketplace that do this response transforming stuffs in a more configurable way. Checkout this if you are interested.

@nokidding
nokidding / updateNpm.bat
Created March 31, 2020 13:08
Windows batch file which updates npm for nvm-windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@fworks
fworks / install-zsh-windows-git-bash.md
Last active April 19, 2024 19:52
Zsh / Oh-my-zsh on Windows Git Bash
@matthewsuan
matthewsuan / axios.js
Last active March 28, 2024 12:36
Axios request queue-like that limits number of requests at any given time
import axios from 'axios'
const MAX_REQUESTS_COUNT = 5
const INTERVAL_MS = 10
let PENDING_REQUESTS = 0
// create new axios instance
const api = axios.create({})
/**
@jarvisluong
jarvisluong / configureStore.js
Created September 22, 2018 18:50
Custom redux persist version for redux-offline
//@flow
import { createStore, applyMiddleware } from 'redux';
import storage from 'redux-persist/lib/storage'
import { composeWithDevTools } from 'redux-devtools-extension';
import { persistStore, persistReducer } from 'redux-persist';
import thunk from 'redux-thunk';
import reducer from 'reducers';
import { createOffline } from '@redux-offline/redux-offline';
import offlineConfig from '@redux-offline/redux-offline/lib/defaults/index';
@danihodovic
danihodovic / main.tf
Created January 8, 2017 20:48
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"
@wojteklu
wojteklu / clean_code.md
Last active April 26, 2024 16:51
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@michaellihs
michaellihs / tmux-cheat-sheet.md
Last active April 21, 2024 20:22
tmux Cheat Sheet
@darkcolonist
darkcolonist / Kohana.php
Last active May 26, 2016 05:47
modifications with respect to /kohana.project/system/core/Kohana.php
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Provides Kohana-specific helper functions. This is where the magic happens!
*
* $Id: Kohana.php 4372 2009-05-28 17:00:34Z ixmatus $
*
* @package Core
* @author Kohana Team
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
@darkcolonist
darkcolonist / mustache-test.html
Created February 12, 2016 06:35
simple usage of mustache.js
<html>
<head>
<title>mustache says hi!</title>
</head>
<body>
<table id="students">
<thead>
<tr>
<th>ID</th>