Skip to content

Instantly share code, notes, and snippets.

View yusufusta's full-sized avatar
💪
Hard working

Yusuf Usta yusufusta

💪
Hard working
View GitHub Profile
function dataURItoBlob(dataURI) {
// convert base64/URLEncoded data component to raw binary data held in a string
var byteString;
if (dataURI.split(',')[0].indexOf('base64') >= 0)
byteString = atob(dataURI.split(',')[1]);
else
byteString = unescape(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
package com.tencent.imsdk.sns.base;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import com.amazonaws.services.s3.internal.Constants;
import com.tencent.imsdk.IMCallback;
import com.tencent.imsdk.IMConfig;
import com.tencent.imsdk.IMErrorMsg;
import com.tencent.imsdk.IMException;
@yusufusta
yusufusta / BasicPHPFramework.php
Last active November 25, 2022 17:49
Proof that PHP works well without any framework.
<?php
function redirect(string $url)
{
header("Location: $url");
die();
}
function json(array $arr)
{
# ubuntu 22.04
function downloadLatestPhp(){
result=$(wget -qO- 'https://www.php.net/releases/index.php?json&max=1')
version_name=$(echo $result | jq -r .[keys[-1]].version)
url=$(echo $result | jq -r .[keys[-1]].source[0].filename)
wget "https://www.php.net/distributions/$url";
tar -xvf $url
cd "php-$version_name"
}
import random
def randomlySplitString(string: str):
list = []
lastStrPosition = 0
while True:
random_number = lastStrPosition + random.randint(0, len(string) / 4)
list.append(string[lastStrPosition:random_number])
phpbrew install 7.4.28 +default +zts +dbs +gd +debug -- --with-iconv=`brew --prefix libiconv` --enable-embed
["1.0","1.0.1","1.0.2","1.1","1.1","1.1.1","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","2.0","2.0.1","2.0.2","2.1","2.1.1","2.1.1","2.2","2.2","2.2.1","2.2.1","3.0","3.0.1","3.1","3.1.1","3.1.1","3.1.2","3.1.3","3.2","3.2.1","3.2.2","4.0","4.0.1","4.0.2","4.1","4.2.1","4.2.1","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.3","4.3.1","4.3.2","4.3.3","4.3.4","4.3.5","5.0","5.0.1","5.0.1","5.1","5.1","5.1.1","5.1.1","6.0","6.0","6.0","6.0.1","6.0.1","6.0.1","6.0.2","6.0.2","6.0.2","6.1","6.1","6.1","6.1","6.1.1","6.1.2","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","7.0","7.0","7.0.1","7.0.2","7.0.3","7.0.4","7.0.5","7.0.6","7.1","7.1","7.1.1","7.1.2","8.0","8.0","8.0.1","8.0.2","8.1","8.1","8.1.1","8.1.1","8.1.2","8.1.3","8.2","8.3","8.3","8.4","8.4.1","9.0","9.0","9.0","9.0","9.0.1","9.0.1","9.0.2","9.1","9.2","9.2.1","9.2.1","9.3","9.3","9.3","9.3","9.3.1","9.3.2","9.3.2","9.3.3","9.3.4","9.3.5","9.3.6","10.0","10.0","10.0.2","10.0.3","10.1","10.1","10.1.1","10.1.1","10.2","10.2.1","10.3","10.3.1","10.3.2","10.3.2
['iPhone7,1', 'iPhone7,2', 'iPhone8,1', 'iPhone8,2', 'iPhone8,4', 'iPhone9,1', 'iPhone9,2', 'iPhone9,3', 'iPhone9,4', 'iPhone10,1', 'iPhone10,2', 'iPhone10,3', 'iPhone10,4', 'iPhone10,5', 'iPhone10,6', 'iPhone11,2', 'iPhone11,4', 'iPhone11,6', 'iPhone11,8', 'iPhone12,1', 'iPhone12,3', 'iPhone12,5', 'iPhone12,8', 'iPhone13,1', 'iPhone13,2', 'iPhone13,3', 'iPhone13,4', 'iPhone14,2', 'iPhone14,3', 'iPhone14,4', 'iPhone14,5']
@yusufusta
yusufusta / news_lang_list.json
Created February 15, 2022 17:39
Google news lang list
[{"name":"TR:tr","lang":"Türkçe (Türkiye)"},{"name":"DE:de","lang":"Deutsch (Deutschland)"},{"name":"AT:de","lang":"Deutsch (Österreich)"},{"name":"CH:de","lang":"Deutsch (Schweiz)"},{"name":"ID:id","lang":"Bahasa Indonesia (Indonesia)"},{"name":"CZ:cs","lang":"Čeština (Česko)"},{"name":"AU:en","lang":"English (Australia)"},{"name":"BW:en","lang":"English (Botswana)"},{"name":"CA:en","lang":"English (Canada)"},{"name":"ET:en","lang":"English (Ethiopia)"},{"name":"GH:en","lang":"English (Ghana)"},{"name":"IN:en","lang":"English (India)"},{"name":"ID:en","lang":"English (Indonesia)"},{"name":"IE:en","lang":"English (Ireland)"},{"name":"IL:en","lang":"English (Israel)"},{"name":"KE:en","lang":"English (Kenya)"},{"name":"LV:en","lang":"English (Latvia)"},{"name":"MY:en","lang":"English (Malaysia)"},{"name":"NA:en","lang":"English (Namibia)"},{"name":"NZ:en","lang":"English (New Zealand)"},{"name":"NG:en","lang":"English (Nigeria)"},{"name":"PK:en","lang":"English (Pakistan)"},{"name":"PH:en","lang":"English (Phil
@yusufusta
yusufusta / azure_scraper.js
Last active February 2, 2022 14:40
azure tts
var result = [];
var sounds = Array.from(
document.querySelectorAll(
"#main > div.content > div:nth-child(18) > table > tbody > tr"
)
);
sounds.map((sound) => {
result.push({