This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/static/dashboard/js/axios.min.js"></script> (From https://github.com/axios/axios) | |
<script src="/static/dashboard/js/sweetalert.min.js"></script> (From https://sweetalert.js.org to make a beautiful alert) | |
<script src="/static/dashboard/js/jsform.js"></script> | |
=============== html input ================== | |
Put formValidate id & name into your form attribute. | |
ex. <form id="formValidate" name="formValidate"> | |
and don't forget to have button or input with submit type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var RESPONSES = { | |
"400": "It appears you've encountered an error. Sorry about that", | |
"403": "It appears you've encountered an error. Sorry about that", | |
"404": "It appears you've encountered an error. Sorry about that", | |
"304": "It appears you've encountered an error. Sorry about that", | |
"505": "It appears you've encountered an error. Sorry about that", | |
"500": "It appears you've encountered an error. Sorry about that", | |
"false": "It appears you've encountered an error. Sorry about that", | |
"loading": "<font color='black'>Loading...</font>", | |
"loaderimg": "<img src='/static/loader-connect2.gif' style='width:16px;heigth:16px;'/>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import | |
from config import base | |
import os, sys | |
import re | |
import random | |
import string | |
import hashlib | |
import uuid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
countries = [ | |
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'}, | |
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'}, | |
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"}, | |
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'}, | |
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'}, | |
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'}, | |
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://drive.google.com/open?id=1TQlvzXp4v5i-Ogsuu4g7SoTkH50-j2ba |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flashback | |
I've been using jquery for almost 4 years, and I was using ajaxform to simplify my form post process | |
http://jquery.malsup.com/form/ but now I know that I need to move. Its crazy how everything changed in just one single year. | |
I try to find another approach that close to the native approach and then I found axios js https://github.com/axios/axios | |
which is really good for another XMLHttpRequests solution and to make it more simple to move my code from jquery to native approach | |
I made some function everybody might can use it. | |
The function is simple just put this on file with name form.js or you named it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: TypeError: Cannot read property 'component---src-pages-index-js' of undefined | |
Inspect -> clear storage -> clear site data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. | |
# | |
# This library is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
# Lesser General Public License for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib2 ##-->modul urllib2 untuk menghandle url request | |
import BeautifulSoup ##-->import modul HTML/XML parsing | |
import sys | |
import urllib | |
from BeautifulSoup import BeautifulSoup as bs | |
import urlparse | |
from urllib2 import urlopen | |
from urllib import urlretrieve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.chrome.options import Options | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC |