Skip to content

Instantly share code, notes, and snippets.

View doanhpv-0200's full-sized avatar
๐Ÿ™ƒ

Pham Van Doanh doanhpv-0200

๐Ÿ™ƒ
View GitHub Profile
@doanhpv-0200
doanhpv-0200 / auth.js
Created August 14, 2021 08:23 — forked from zolotyx/auth.js
Nuxt Auth Redirect Fix
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]
export const isRelativeURL = u =>
u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u)
export default function ({ app }) {
const redirect = function (name, noRouter = false) {
if (!this.options.redirect) {
return
}
@doanhpv-0200
doanhpv-0200 / release-android-debuggable.md
Created November 7, 2018 01:11 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@doanhpv-0200
doanhpv-0200 / swipe_item.xml
Created April 2, 2018 14:47
Swipe item for AndroidSwipeLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent">
<com.daimajia.swipe.SwipeLayout xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@doanhpv-0200
doanhpv-0200 / i3-lock.md
Last active June 18, 2019 06:55
Install i3-lock color

Install i3-lock

git clone https://github.com/PandorasFox/i3lock-color.git 
cd i3lock-color
apt install libev-dev libxcb-composite0 libxcb-composite0-dev libxcb-xinerama0 libxcb-randr0  libxcb-xinerama0-dev  libxcb-xkb-dev  libxcb-image0-dev  libxcb-util-dev libxkbcommon-x11-dev libjpeg-turbo8-dev  libpam0g-dev libcairo2-dev libxcb-xrm-dev dh-autoreconf libxcb-randr0-dev libxcb-xtest0-dev libxkbcommon-dev
autoreconf -i && ./configure 
cd x86_64-pc-linux-gnu
make -j8
@doanhpv-0200
doanhpv-0200 / InfoCommand.php
Created February 22, 2018 09:14
Laravel Zero
<?php
namespace App\Commands;
use App\Commands\Helper\MovieHelper;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
class InfoCommand extends Command
{
@doanhpv-0200
doanhpv-0200 / SpeechRecognizerManager.java
Created January 29, 2018 10:09
SpeechRecognizerManager
/**
* Created by doanh on 18/01/2018.
*/
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.speech.RecognitionListener;
import android.speech.RecognizerIntent;
<?php
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading"><strong>Two Factor Authentication</strong></div>
<div class="panel-body">
@doanhpv-0200
doanhpv-0200 / install_lamp_16.sh
Created November 24, 2017 09:17 — forked from ankurk91/install_lamp_ubuntu.sh
Ubuntu 16.04 - PHP development (php 7.1, MySQL 5.7, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 16.04 Dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@doanhpv-0200
doanhpv-0200 / snippets.cson
Created September 7, 2017 03:55
Atom Snippets for React
'.source.js':
'New React Class':
'prefix': 'new-react-class'
'body': '''
import React from 'react';
class ${1:App} extends React.Component {
constructor(props) {
super(props);
}
@doanhpv-0200
doanhpv-0200 / welcome.blade.php
Created August 28, 2017 03:44
Simple welcome page with version info for Lumen
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lumen</title>
<!-- Fonts -->