Skip to content

Instantly share code, notes, and snippets.

View thgiang's full-sized avatar
🎯
Focusing

Tran Hoang Giang thgiang

🎯
Focusing
View GitHub Profile
@thgiang
thgiang / gist:e222f036806f126f51a0b75a81956c20
Created March 2, 2021 16:17
Control real chrome browser without notice: "Chrome is being controlled by automated test software"
Random rd = new Random();
string remote_port = rd.Next(9000, 9999).ToString();
// Open real Chrome
Process process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = "https://thgiang.com --load-extension=\"C:\\Users\\Admin\\Desktop\\my_extension\" --disable-gpu --new-window --remote-debugging-port=" + remote_port + " --user-data-dir=\"C:\\Profile\" --proxy-server=\""+proxy+"\" --disable-infobars --disable-notifications --window-size=1366,768"; //--window-position=0,0 --window-size=1200,800 --disable-images
process.Start();
Thread.Sleep(1000);
@thgiang
thgiang / TableVirtualScroller.vue
Last active June 18, 2020 06:56
A small Vue component to render big array of items. It will not render invisible <tr> tags. This help increase performance.
READ AND REMOVE ME: Replace this.$store.state.blogs.data by your items array
READ AND REMOVE ME: currentScrollPosition + 1000 mean only render from current position + 1000px, you can change as you want
<template>
<table class="table table-fixed">
<thead>
<tr>
<th scope="col">Content</th>
</tr>
</thead>
@thgiang
thgiang / LOL TOTAL URL
Last active January 18, 2024 09:41
League of Legend all URL
GET /entitlements/v1/token
GET /lol-account-verification/v1/device
POST /lol-account-verification/v1/invalidate
GET /lol-account-verification/v1/is-verified
POST /lol-account-verification/v1/send-token
POST /lol-account-verification/v1/verify
POST /lol-acs/v1/acs-endpoint-override
GET /lol-acs/v1/delta
GET /lol-acs/v1/games/{gameId}
GET /lol-acs/v1/gametimelines/{gameId}
@thgiang
thgiang / JSN UniForm validate password before send
Created August 31, 2017 02:29
A field to input password and validate it before submit the contact form.
// Please see my video: https://drive.google.com/file/d/0B0q3Kha3KEfUZFhsdFA2MlpuU2s/view?usp=sharing
//Code:
//ID of password field
$field_id = 28;
//List of password
$accepted = array('bravebits','joomlashine','woorocket','sellersmith','golden','river');
if (!in_array($post['password'][$field_id][0], $accepted))
{
@thgiang
thgiang / Kunena auto avatar by UserName
Created August 10, 2017 17:09
Kunena auto avatar by UserName
(function($) {
var backgroundColors = ['#00AAF7','#FF6C00','#243341','#FF0D3E','#64BB21'];
$('.profilebox li img').each(function(){
if ($(this).attr('src').indexOf('nophoto.png') !== -1)
{
var userName = $(this).attr('alt').replace('\'s Avatar','');;
console.log(userName);
var matches = userName.match(/\b(\w)/g);
console.log(matches);
if (matches)