Skip to content

Instantly share code, notes, and snippets.

View svmihar's full-sized avatar
🙏

sumihar christian svmihar

🙏
View GitHub Profile

Keybase proof

I hereby claim:

  • I am svmihar on github.
  • I am svmihar (https://keybase.io/svmihar) on keybase.
  • I have a public key whose fingerprint is 9E97 2B8A CE2A 2EC7 13FC 205F A7BF 0E81 55B9 F6F7

To claim this, I am signing this object:

@svmihar
svmihar / graphql_example.py
Created February 10, 2019 01:16 — forked from gbaman/graphql_example.py
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
import cv2
from time import sleep, time
import sys
import curses
from curses import wrapper
x = 160
sx = 4
@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 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):
""" 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
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
@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.

@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
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