Skip to content

Instantly share code, notes, and snippets.

View rririanto's full-sized avatar
🏠
Working from home

Rahmat Ramadhan rririanto

🏠
Working from home
View GitHub Profile
<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.
@rririanto
rririanto / responses.js
Created February 4, 2019 16:03
Init for Responses Mapping
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;'/>",
@rririanto
rririanto / indonesia-area-autoimport.py
Last active December 24, 2019 17:52
Auto Import Indonesia area to Database over Django
#!/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
@rririanto
rririanto / countryinfo.py
Created December 17, 2019 04:25 — forked from pamelafox/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
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
https://drive.google.com/open?id=1TQlvzXp4v5i-Ogsuu4g7SoTkH50-j2ba
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.
@rririanto
rririanto / gist:cc3770cfef61494ef1a1372a60ff34c2
Created March 24, 2020 14:37
TypeError: Cannot read property 'component---src-pages-index-js' of undefined
Error: TypeError: Cannot read property 'component---src-pages-index-js' of undefined
Inspect -> clear storage -> clear site data
@rririanto
rririanto / ExploitSearch.py
Created June 30, 2020 13:34
Archive-ExploitSearch.py
#!/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.
@rririanto
rririanto / romanticdevil-crawlers.py
Created June 30, 2020 13:42
Archive romanticdevil-crawlers.py
#!/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
@rririanto
rririanto / mobile-web-test.py
Last active July 19, 2020 13:59
Python Using Selenium WebDriver to Run Mobile Web Tests
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