Skip to content

Instantly share code, notes, and snippets.

View svmihar's full-sized avatar
🙏

sumihar christian svmihar

🙏
View GitHub Profile
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults delete -g ApplePressAndHoldEnabled # If necessary, reset global default
"""
12 hour colab session buat lab komputer
"""
import webbrowser
import string
import time
import random
import fire
import pyautogui
import sys
import os, time
"""
1. install tmux
2. masuk tmux
3. install ngrok
4. ambil authtoken
5. ./ngrok authtoken ambil_authtoken
6. pip3 install jupyterlab pipenv
@svmihar
svmihar / Google Colab SSH
Created July 10, 2019 02:44 — forked from yashkumaratri/Google Colab SSH
SSH into google colab
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@svmihar
svmihar / git-change-commit-messages.md
Created June 8, 2019 02:55 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

from multiprocessing import Process, current_process
import multiprocessing
def g(str):
i = 0
new_str = ""
while i < len(str) -1:
new_str = new_str + str[i+1]
i = i+1
return new_str
""" def f(arr1, arr2):
k = arr2[3]
ct = 0
while k > arr2[2]-1:
if (arr1[k] <= arr2[1] and not arr1[k] <= arr2[0]):
ct = ct + 1
k = k - 1
return ct
import pandas as pd
import json
import requests
url = 'https://www.tokopedia.com/reputationapp/review/api/v2/product/269922085?page=1&total=20'
kumpulan_url = []
for i in range(1, 401):
@svmihar
svmihar / scrape_kompas.py
Last active April 28, 2024 08:21
scrape seluruh paragraf berita yang ada di indeks.kompas.com
from bs4 import BeautifulSoup
import requests
# url = 'https://indeks.kompas.com/'
# url='https://indeks.kompas.com/all/2019-04-01/2'
url = 'https://indeks.kompas.com/all/2019-04-01/3'
req = requests.get(url)
# print(req.text)
import cv2
from time import sleep, time
import sys
import curses
from curses import wrapper
x = 160
sx = 4