Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
@hiepxanh
hiepxanh / search.js
Last active November 24, 2017 17:29
trinh dam dang
$(document).ready(function () {
$("#id_thehien").on('change', function () {
var optionId = $('option:selected', this).attr('id');
if (optionId === 'all') {
reset_vl();
hide_lun();
$("#class").hide();
}
@hiepxanh
hiepxanh / backup.js
Created November 24, 2017 17:42
trinh
$( document ).ready(function() {
$("#id_thehien").on('change', function() {
var optionId = $('option:selected', this).attr('id');
if(optionId === 'all') {
reset_vl();
hide_lun();
$("#class").hide();
}
@hiepxanh
hiepxanh / self-intro.ps1
Created November 25, 2017 12:43
microsoft voice self introduce
Add-Type -AssemblyName System.speech | Out-Null
$spk = new-object System.Speech.Synthesis.SpeechSynthesizer
$voices = $spk.GetInstalledVoices().voiceinfo
foreach($voice in $voices){$spk.SelectVoice($voice.Name);$spk.Speak($voice.name)}
@hiepxanh
hiepxanh / home.ts
Last active February 7, 2018 08:27
check sms OTP
// STEP 1:
// {{ install these command in CMD, turn off adb.exe process if you already run, turn off in Window Task Manager }}
// {{ Open Administrator CMD, Must be Administrator}}
// ionic cordova plugin add cordova-plugin-android-permissions
// ionic cordova plugin add cordova-plugin-sms
// yarn add @ionic-native/android-permissions
// yarn
// {{ run last command to check all node_modules }}
// STEP 2: add 'AndroidPermissions' in app.module.ts 'providers'
@hiepxanh
hiepxanh / getHTML.ts
Created February 8, 2018 07:41
get HTML request
getHTML() {
return this.http.request('GET','api/account/login',{observe:'response',responseType:'text'})
.map((res:HttpResponse<any>) => { console.log(res.body); return res.body })
}
@hiepxanh
hiepxanh / api.ts
Last active February 8, 2018 07:42
themeable Browser for ionic
cssVariable: string = `
#header, #breadcrumb-wrapper, #footer,#mobile-bottom-navigation, #back-to-top {
display:none;
}
body {
padding-bottom: 80px;
padding-top: 1px;
}
`
@hiepxanh
hiepxanh / selenium-js-hover-btn.ts
Created March 7, 2018 09:35
selenium javascript hover button with async await
async login(driver:WebDriver) {
await driver.get('https://tiki.vn');
let loginElement = await driver.findElement(By.id('header-user'));
let strJavaScript = "var element = arguments[0];"
+ "var mouseEventObj = document.createEvent('MouseEvents');"
+ "mouseEventObj.initEvent( 'mouseover', true, true );"
+ "element.dispatchEvent(mouseEventObj);";
await driver.executeScript(strJavaScript, loginElement);
}
@hiepxanh
hiepxanh / cloudSettings
Last active March 14, 2018 07:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-03-14T07:06:28.319Z","extensionVersion":"v2.9.0"}
@hiepxanh
hiepxanh / cloudSettings
Created March 14, 2018 07:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-03-14T07:28:48.408Z","extensionVersion":"v2.9.0"}
@hiepxanh
hiepxanh / install.bat
Created April 5, 2018 06:43 — forked from stormoz/install.bat
Start Selenium Grid hub and nodes as Windows services
nssm install SeleniumHub java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role hub
nssm start SeleniumHub
nssm install SeleniumNode1 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe
nssm set SeleniumNode1 DependOnService SeleniumHub
nssm start SeleniumNode1
nssm install SeleniumNode2 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe
nssm set SeleniumNode2 DependOnService SeleniumHub
nssm start SeleniumNode2