Skip to content

Instantly share code, notes, and snippets.

View fzed51's full-sized avatar
πŸ‘¨β€πŸ’»
I may be slow to respond.

Fabien S. fzed51

πŸ‘¨β€πŸ’»
I may be slow to respond.
View GitHub Profile
@dypsilon
dypsilon / .eslintrc.json
Created May 30, 2023 21:29
TypeScript ESLint Prettier Setup
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
@cmstead
cmstead / gist:7ad64539d13dfdb5a2591bc3be3c8eeb
Last active March 3, 2024 06:40
VS Code snippet transform: convert camel case to Pascal case or vice versa
// If you want to convert a PascalCase variable to camelCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/downcase}${2}/}
// Example: ${1:This is my original} => ${1/^(.)(.*)$/${1:/downcase}${2}/}
// If you want to convert a camelCase variable to PascalCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/upcase}${2}/}
@sgissinger
sgissinger / MCD.puml
Created November 8, 2018 23:01
PlantUML with customizations
@startuml
!define table(x) class x << (T,#FFAAAA) >>
!define view(x) class x << (V,#33CCFF) >>
!define pk(x) +<u>x</u>
!define fk(x,y) ~x <i>references y</i>
!define pkfk(x,y) -<u>x</u> <i>references y</i>
hide methods
hide stereotypes
skinparam shadowing false
@INQTR
INQTR / axios-interceptors-refresh-token.js
Last active March 2, 2025 13:30
Axios interceptors token refresh for few async requests. ES6
import axios from "axios";
import { settings } from "../settings";
import { authAPI } from ".";
const request = axios.create({
baseURL: settings.apiV1,
});
request.interceptors.request.use(
(config) => {
@zcmgyu
zcmgyu / CHANGELOG.md
Created December 28, 2017 17:10 — forked from dispix/CHANGELOG.md
OAUTH2 Authentication and token management with redux-saga

Revision 5

  • Fix error parsing

Revision 4

  • Add missing yield in the login function

Revision 3

@bohwaz
bohwaz / get_time_from_ntp.php
Created April 28, 2017 02:48
Fetches timestamp from a NTP server in PHP
<?php
/**
* Returns UNIX timestamp from a NTP server (RFC 5905)
*
* @param string $host Server host (default is pool.ntp.org)
* @param integer $timeout Timeout in seconds (default is 10 seconds)
* @return integer Number of seconds since January 1st 1970
*/
function getTimeFromNTP($host = 'pool.ntp.org', $timeout = 10)
@MattSeen
MattSeen / .gitconfig
Last active April 30, 2024 09:20
These are a series of the Git alias I use on use on a daily basis. I have included references to the places where I have found each one to give the authors due credit.
[alias]
# Source: http://stackoverflow.com/questions/7066325/how-to-list-show-git-aliases#answer-7067489
# Found on stackoverflow list all available aliases ==
alias = config --get-regexp '^alias.*'
s = status
ss = status --short
ssb = status --short --branch
co = commit
@bzerangue
bzerangue / array2xml.php
Last active June 28, 2023 04:29
Decoding JSON to a PHP Array and then converting it to XML.
<?php
/**
* Array2XML: A class to convert array in PHP to XML
* It also takes into account attributes names unlike SimpleXML in PHP
* It returns the XML in form of DOMDocument class for further manipulation.
* It throws exception if the tag name or attribute name has illegal chars.
*
* Author : Lalit Patel
* Website: http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes
* License: Apache License 2.0
@chklauser
chklauser / Manage-AppConfig.ps1
Created July 22, 2012 19:23
PowerShell script to make ~\Documents more usable, hides directories and makes them accessible via a symlink in a different location.
param(
[Parameter(Position=0)]
$Item,
[Switch] $WhatIf,
[String] $AppConfig = "$env:HOMEDRIVE$env:HOMEPATH\AppConfig",
[String] $BaseDir = ".",
[Parameter(ParameterSetName="register")]
[Switch]
$Register,
@jpoehls
jpoehls / mklink.psm1
Created June 7, 2012 19:40
Native PowerShell wrapper for MKLINK.