Skip to content

Instantly share code, notes, and snippets.

View tdchien's full-sized avatar
🛴
Working hard

Chien Tran tdchien

🛴
Working hard
View GitHub Profile
@yajra
yajra / axios-401-response-interceptor.js
Last active September 20, 2023 06:24
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,
Works to me, when i uninstall the app "Mi fit" and after "Mi band control".
Now, enter in you apps configuration, unpair and clear bluetooth cache.
Restart the phone.
Install "Mi fit" again.
Log in, and pair the mi band 2 with your device!
Enjoy!
Vinícius Feitosa da Silva
----
@tdchien
tdchien / Preferences.sublime-settings
Last active December 31, 2017 07:41
Sublime Text 3 - User setting
{
"color_scheme": "Packages/Agila Theme/Agila Dracula.tmTheme",
"default_line_ending": "unix",
"detect_indentation": true,
"detect_slow_plugins": false,
"drag_text": false,
"draw_white_space": "all",
"fallback_encoding": "UTF-8",
"font_size": 11,
"highlight_line": false,
@christopher-hopper
christopher-hopper / PHP-Interactive-CLI-Install-from-Source.md
Last active March 17, 2024 10:23
Install PHP from a source download to enable its interactive command-line shell interface on Linux.

PHP Interactive CLI Install

The following commands can be used to install PHP from source with an interactive command-line shell interface on Linux.

This interactive shell, (command: php -a) was the main reason I built from source to begin with. Now though I am able to play with the latest PHP versions as soon as they are available.

The commands below were written for and tested on the following system.

  • OS: Ubuntu 14.04.4 LTS (trusty)
@h-collector
h-collector / Foo.php
Last active November 1, 2023 16:32
Standalone Laravel Queue + Redis example
<?php
namespace Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Redis\Database as Redis;
class Foo extends Job
{
use InteractsWithQueue;
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 22, 2024 20:58
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@df-jablan
df-jablan / .bash-git-aliases.sh
Created February 4, 2016 21:57
I ♥ Aliases | ba/sh aliases for git/git-flow | Please source responsibly
#!/bin/bash
######################################################################
## Git Aliases
######################################################################
alias glog='git log --name-only'
alias gb='git branch --list -v'
alias gcm='git checkout master'
alias gcd='git checkout develop'
@taylorotwell
taylorotwell / tenant-middleware
Created December 1, 2015 03:07
Magical tenant middleware thing
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Auth\Access\AuthorizationException;
class VerifyTenants
{
/**
@vluzrmos
vluzrmos / compat_l5.php
Last active November 1, 2022 20:43
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)