Skip to content

Instantly share code, notes, and snippets.

@yanwei07
yanwei07 / Set A Custom Screen Resolution in Ubuntu Desktop
Created January 2, 2020 08:07
How to Set A Custom Screen Resolution in Ubuntu Desktop
1. run command: xrandr
it output current screen resolution as well as available solutions. All we need here is the display device name.
examle device name : virtual1.
2. Run command to calculate VESA CVT mode lines by given resolution which you will add value, example :
sudo cvt 1600 900
if your device support this resolution, terminal would output it's ability. look follow output:
1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
@yanwei07
yanwei07 / help.md
Last active December 12, 2019 11:12
Using offline Material icons and Roboto font in Electron app

first:

  1. npm install material-design-icons --save
  2. npm install typeface-roboto --save

Then go to main.js and import them
import 'material-design-icons/iconfont/material-icons.css'
import 'typeface-roboto/index.css'

@yanwei07
yanwei07 / html-webpack-plugin
Created November 29, 2019 03:43
vue for multiple page
// ...
const config = {
// ...
}
// ...
glob.sync('./src/pages/**/app.html').forEach(path => {
// Get all the html template files and forEach them
// E.g, path = './src/pages/user/index/app.html'
const chunk = path.split('./src/pages/')[1].split('/app.html')[0]
@yanwei07
yanwei07 / index.js
Created November 29, 2019 03:41
vue router for mulitple page
import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Docxso from '@/components/Docxso'
Vue.use(Router)
let router = new Router({
routes: [
{
path: '*',
redirect: '/'
@yanwei07
yanwei07 / webpack.config.conf
Created November 29, 2019 03:01
webpack.config.conf file for multiplepage
module.exports = {
entry: {
app: './src/app.js',
mgmt: ['./src/modules/mgmt/mgmt.js'],
login: './src/modules/login/login.js'
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
@yanwei07
yanwei07 / AndroidBug5497Workaround.java
Created May 13, 2019 09:48 — forked from beilly/AndroidBug5497Workaround.java
WebView adjustResize windowSoftInputMode breaks when activity is fullscreen.Depent on https://github.com/madebycm/AndroidBug5497Workaround
package com.vcredit.utils;
import android.app.Activity;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
/**
* Created by shibenli on 2016/8/31.
#include <windows.h>
#include <shlobj.h>
#include <exdisp.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int iCmdShow)
{
// Initialize the use of COM objects...
CoInitialize(NULL);
// Create a Shell object pointer...
@yanwei07
yanwei07 / EachDirectoryPath.md
Created April 3, 2019 06:25 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@yanwei07
yanwei07 / build-boost-for-android.sh
Created July 17, 2018 10:09 — forked from enh/build-boost-for-android.sh
Shell script to build boost for Android
#!/bin/bash
version=1.67.0
echo "Building boost $version..."
set -eu
toolchain=$PWD/toolchain
if [ ! -d "$toolchain" ]; then
echo "Building toolchain..."
@yanwei07
yanwei07 / CustomVideoView.java
Created April 25, 2018 10:23 — forked from aaalaniz/CustomVideoView.java
VideoView that notifies of a frame rendered after requesting a reset
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import com.twilio.video.I420Frame;
import com.twilio.video.VideoView;
/*
* VideoView that notifies Listener of the first frame rendered and the first frame after a reset