Skip to content

Instantly share code, notes, and snippets.

View AstDerek's full-sized avatar

Ast Derek AstDerek

View GitHub Profile
@motanelu
motanelu / multiple_inheritance_example.php
Created January 21, 2012 12:31
Multiple Inheritance in PHP
<?php
/**
* Abomination class implementing multiple inheritance via
* __call magic method
*/
abstract class MultipleInheritance
{
/**
* List of parent classes
*
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Simbul
Simbul / pre-commit
Created February 9, 2012 18:06
Git hook to prevent commits on a staging/production branch
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]
@shrop
shrop / brewStack.md
Last active October 11, 2023 20:18
brewStack Docs
@ThomasBurleson
ThomasBurleson / $QDecorator.js
Created March 23, 2014 15:51
Decorate the AngularJS $q instance to inject spread() and resolve() functionality.
/**
* @author Thomas Burleson
* @date November, 2013
* @copyright 2013 Mindspace LLC.
* @web http://solutionOptimist.com
*
* @description
*
* Used within AngularJS to decorate/enhance the AngularJS `$q` service.
*
@culttm
culttm / axios.refresh_token.js
Created October 5, 2017 18:46
axios interceptors for refresh token
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
originalRequest._retry = true;
@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {