Skip to content

Instantly share code, notes, and snippets.

View adibenc's full-sized avatar
🎯
Focusing

M Adib zamzam adibenc

🎯
Focusing
View GitHub Profile
@adibenc
adibenc / messize.py
Created March 5, 2021 04:46
messize.py
#!/usr/bin/python3
import random
sentence="""[wiki] A typographical error (often shortened to typo), also called misprint, is a mistake (such as a spelling mistake)[1] made in the typing of printed (or electronic) material. Historically, this referred to mistakes in manual type-setting (typography). The term includes errors due to mechanical failure or slips of the hand or finger,[2] but excludes errors of ignorance, such as spelling errors, or changing and misuse of words such as "than" and "then". Before the arrival of printing, the "copyist's mistake" or "scribal error" was the equivalent for manuscripts. Most typos involve simple duplication, omission, transposition, or substitution of a small number of characters."""
sentence="""but magically we still can interpret what is written."""
# sentence=""" """
print(sentence)
words = sentence.split(" ")
# suf1, suf2
def messize(w, preflen = 4, mid1 = 2, midlen = 4, suflen = 2):
.
./.codeclimate.yml
./.vscode
./.vscode/settings.json
./app
./app/account
./app/account/forms.py
./app/account/views.py
./app/account/__init__.py
./app/admin
@adibenc
adibenc / main.go
Created February 23, 2021 09:35
base json returner
package main
import (
"encoding/json"
"fmt"
)
type BaseResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
@adibenc
adibenc / run-syn.md
Created December 23, 2020 10:03
run sinonim

Sinonim

1. Load Data

LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/adib-enc/d01f3413665615232bb6ce1b8a8ed2c3/raw/ff374363111f6249e7738dc004ed61e993df0385/sino.csv' as row
MERGE (k:Kata {kata: row.wx})
MERGE (s:Sinonim {sinonim: row.wsinonim, w1: row.w1, w2: row.w2, wx: row.wx});

2. Create graph

@adibenc
adibenc / sino.csv
Created December 22, 2020 14:09
sinonim
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 12 columns, instead of 6 in line 8.
id,idcommerce,idcommerce2,idsubproses,idsubproses2,subp,subp2,w1,w2,wx,wsinonim,created_at
1,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,pendaftaran,pencatatan,2020-12-19 11:52:25
2,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,pendaftaran,pendataan ,2020-12-19 11:52:25
3,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,pendaftaran,registrasi,2020-12-19 11:52:25
4,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,memeriksa ,menguji,2020-12-19 11:52:25
5,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,memeriksa ,memverifikasi,2020-12-19 11:52:25
6,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran,memeriksa ,memeriksa ,membuktikan,2020-12-19 11:52:25
7,1,2,1,1,pendaftaran mengisi identitas ,memeriksa nomor telepon ,pendaftaran ,nomor ,pendaftaran ,pencatatan,2020-12-19 11:52:25
8,1,2,1,1,pen
@adibenc
adibenc / ieee.literature.rev.py
Created December 19, 2020 14:53
ieee literature review py
!#/usr/bin/env
"""
https://ieeexplore.ieee.org/search/searchresult.jsp?queryText=literature%20review&highlight=true&returnType=SEARCH&matchPubs=true&pageNumber=11&ranges=2010_2021_Year&returnFacets=ALL
1. open console
arr = []
$('.List-results-items').each(function(i,e){
arr.push($(e).text())
})
JSON.stringify(arr)
import requests
from bs4 import BeautifulSoup
url = "https://news.ycombinator.com/"
upvoted = "upvoted?id=your.user.id&p="
fmt = "hn{}.html"
iframe = """<iframe src="{}" title="description" height="1500" width="800"></iframe>"""
cookies = {
"user":"your cookie"
}
@adibenc
adibenc / postman.util.js
Created December 15, 2020 10:15
postman.util
var intDate = Date.now().toString().substring(0,12);
console.log(intDate)
postman.setEnvironmentVariable('uniqint', intDate);
@adibenc
adibenc / xboxdrv-logitech.ini
Created December 11, 2020 22:24
xboxdrv logitech ini - joystick as mouse
# sudo xboxdrv --config xboxdrv-mouse.ini
[xboxdrv]
evdev=/dev/input/event15
silent=true
[evdev-absmap]
ABS_X=x1
ABS_Y=y1
ABS_HAT0X=x2
ABS_HAT0Y=y2
@adibenc
adibenc / index.js
Created December 5, 2020 08:58
gacha
const express = require('express')
const app = express()
const port = 3000
const cookieParser = require('cookie-parser');
app.use(cookieParser());
require('dotenv').config()
const seedrandom = require('seedrandom')