Skip to content

Instantly share code, notes, and snippets.

View absyah's full-sized avatar

Ardian Bahtiarsyah absyah

View GitHub Profile
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import ElementClickInterceptedException, NoSuchElementException
from time import sleep
from selenium.common.exceptions import NoSuchElementException
EMAIL = "[email protected]"
PASSWORD = "password"
@absyah
absyah / gist:fee9e61302910e0be952f92e5894515f
Created June 17, 2021 03:21
COMMON_LOCAL_TOPIC_ATTEMPT
localUsages
localTopicAttemptsIds
0"60ca11f4997eac001e3defed"
1"60ca12cdfcae46001cc75654"
2"60ca134a997eac001e3deffa"
3"60ca1375997eac001e3df004"
4"60ca13d9997eac001e3df00a"
5"60ca166afcae460019c755d5"
topicAttemptsByIds
60ca11f4997eac001e3defed{
ini ternyata...
[Tue Jun 8 06:08:00 2021] ena 0000:00:06.0: ENA device version: 0.10
[Tue Jun 8 06:08:00 2021] ena 0000:00:06.0: ENA controller version: 0.0.1 implementation version 1
[Tue Jun 8 06:08:00 2021] ena 0000:00:06.0: Elastic Network Adapter (ENA) found at mem c0100000, mac addr 0a:4e:87:c9:1f:d7
[Tue Jun 8 06:08:06 2021] ena 0000:00:06.0 eth1: Local page cache is disabled for less than 16 channels
[Tue Jun 8 06:08:14 2021] pci 0000:00:07.0: [1d0f:ec20] type 00 class 0x020000
[Tue Jun 8 06:08:14 2021] pci 0000:00:07.0: reg 0x10: [mem 0x00000000-0x00003fff]
[Tue Jun 8 06:08:14 2021] pci 0000:00:07.0: reg 0x18: [mem 0x00000000-0x000fffff pref]
[Tue Jun 8 06:08:14 2021] pci 0000:00:07.0: enabling Extended Tags
require "rails"
%w(
active_record/railtie
action_controller/railtie
action_view/railtie
action_mailer/railtie
active_job/railtie
action_cable/engine
rails/test_unit/railtie
@absyah
absyah / whiteboard1
Last active December 4, 2019 02:36
Whiteboard Coding Test
cari kata “forstok” dari sebuah kata:
contoh
-ffffforrrrrrstookkkk answer YES
-forastok answer YES
-forlikesvrtyeok answer YES
-dhkortfsuhuahjdhsjhdjshs answer NO
function forstokString(s) {
@absyah
absyah / cURL
Created September 5, 2019 03:39
curl with measures
curl -H "User-Agent: Forstok-System" -H "Authorization: Bearer MmxH1sWGSeuqvbtP2N3NRg" -H "Content-type: application/json" "https://fs.tokopedia.net/v1/order/list?fs_id=13025&from_date=1564974483&to_date=1567739283&page=1&per_page=25&shop_id=2512187" -w "@curl-format" -o /dev/null -s
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
@absyah
absyah / A helpful ActiveRecord setting only 1 person has ever used
Created August 2, 2019 03:23
Nate Berkopec's Ruby Performance Newsletters
A memory-saving ActiveRecord setting has been used by just one application ever, according to GitHub
There's a common performance problem in many Rails background jobs.
Background jobs often do operations across large sets of data. Basically, they do silly things like User.all.each(&:send_daily_newsletter).
So, there's a problem with that query. In development and test environments, User.all will probably return a few rows, maybe a dozen at most. Most developers have extremely limited seed data on their local machines.
In production, however, User.all will probably return quite a few rows. Depending on the app you work on, maybe a few hundred thousand.
There's a tiiiiiny issue with a result set that returns 100,000 rows, and it's not just that the SQL query will take a long time to return. It will have irreversible effects on your Ruby app too!
@absyah
absyah / Docker Commands
Last active August 19, 2019 12:42
Learn Docker
# show containers
docker ps
# Logging to container
docker logs -f <container_id>
# ssh to container
docker exec -it <container_id> /bin/bash
# build container
@absyah
absyah / samples.txt
Created February 21, 2019 01:30
Apisentris API Examples
Apisentris API endpoints
table name: programmers
### Get Programmers
[GET] https://apisentris.com/api/v1/programmers
example:
--------
curl -H "client_id: 141000"\
-H "access_token: 3zov2Syn0ahUfqwuFYw0VQ"\