This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from https://chromium.woolyss.com/ | |
# and https://gist.github.com/addyosmani/5336747 | |
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
sudo apt-get update | |
sudo apt-get install chromium-browser | |
chromium-browser --headless --no-sandbox http://example.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Uyuzum bu elemana | |
// @match http*://*.tahribat.com/* | |
// @grant GM_notification | |
// @grant window.focus | |
// ==/UserScript== | |
var tanrininBelalari=["arabaci88","KaptaN","HolyOne","neverland"].map(function(a){return a.toLowerCase()}),posts=document.querySelectorAll("div.postPanel"),threads=document.querySelectorAll("#activeTopicsBig > tbody > tr"),notificationDetails={text:"{} denen murid artik senin kafani acamaz.",title:"{} gizlendi!",timeout:2900,onclick:function(){alert("Oynama tikim var.");window.focus()}}; | |
0<posts.length&&posts.forEach(function(a){var c=a.querySelector("a").innerText.toLowerCase();if(tanrininBelalari.includes(c)){var b=Object.assign({},notificationDetails);b.text=notificationDetails.text.replace("{}",c);b.title=notificationDetails.title.replace("{}","Cevap");GM_notification(b);a.parentElement.parentElement.remove()}}); | |
0<threads.length&&threads.forEach(function(a){var c=a.querySelector("td:nth-child(2) a").innerText.toLowerCase();if(tanrinin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# globals | |
CWD=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | |
SQLITE_DB=${CWD}/db/auth.db | |
read -sp "Please enter a new admin password: " PASSWORD && printf "\n" | |
pushd ${CWD} && \ | |
export HASH=`${CWD}/pbkdf2_sha256_hash.py ${PASSWORD} | awk '{print substr($2, 2, length($2)-3)}'` && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thumbnail_list = jQuery('.woocommerce-product-gallery__image') | |
if (thumbnail_list.length > 0) { | |
var main_thumb = thumbnail_list.slice(0, 1) | |
thumbnail_list.slice(1).each(function() { | |
jQuery(this).children('a').contents().unwrap() | |
jQuery(this).on('click', function(e) { | |
e.preventDefault(); | |
var thumb = jQuery(this).children() | |
var max_res = (thumb.attr('srcset').split(',') | |
.map(item => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python | |
word_list_tr = { | |
"armut": "pear", | |
"mühendis": "engineer", | |
"aday": "candidate", | |
"niteliksiz": "unskilled", | |
"öğrenci": "schoolgirl", | |
"iş": "business", | |
"beceriksiz": "ineffectual" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://datatofish.com/how-to-connect-python-to-sql-server-using-pyodbc/ | |
import pyodbc | |
conn = pyodbc.connect('Driver={SQL Server};' | |
'Server=server_name;' | |
'Database=database_name;' | |
'Trusted_Connection=yes;') | |
cursor = conn.cursor() | |
cursor.execute('SELECT * FROM database_name.table') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sql_insert(cursor, table, dictionary): | |
columns = ','.join(dictionary.keys()) | |
placeholders = ', '.join('?' * len(dictionary)) | |
sql_cmd = "INSERT INTO {0} ({1}) VALUES ({2})".format(table, columns, placeholders) | |
return cursor.execute(sql_cmd, list(dictionary.values())) | |
#example usage | |
#gene_rows = {} | |
#gene_rows['gene_name'] = parsedCSVColumns['GeneSymbol'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
styles[19].style = Object.values(styles[19].style).map(obj => { | |
const pattern = /(\d*\,\d*)/g | |
let numsWithComma = [...(obj.selector).matchAll(pattern)] | |
console.log(numsWithComma) | |
if (numsWithComma.length > 0) { | |
Object.entries(obj.css).forEach(([key, value]) => { | |
if (value.toString().startsWith('mapData')) { | |
numsWithComma.forEach(([num]) => { | |
obj.css[key] = obj.css[key].replace(new RegExp(num, 'g'), num.replace(',', '.')) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ find . -name '*.txt' -exec iconv --verbose -f windows-1254 -t utf-8 -o {} {} \; | |
$ find . -name '*.srt' -exec iconv --verbose -f windows-1254 -t utf-8 -o {} {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
import json | |
from os.path import realpath, dirname, exists | |
from os import makedirs | |
from shutil import rmtree | |
from PIL import Image | |
BASE_PATH = dirname(realpath(__file__)) |