Skip to content

Instantly share code, notes, and snippets.

Avatar

Hakan ERSU hakanersu

View GitHub Profile
@hakanersu
hakanersu / javascriptValidate.js
Last active Jun 28, 2020
Validate turkish identity number with es6 functions.
View javascriptValidate.js
/**
* Cogu dogrulama kosullari saglayip saglamadigina bakar.
* burada ise bize verilen girdi ile algoritmaya gore
* yeni bir deger uretilir ve son olarak bu deger ile
* girdi karsilastirilir.
* Acikcasi bu yontemin daha performansli oldugu kanaatinde degilim
* ama es6 fonksiyonlariyla biraz oynamak istedim.
*/
const validateTcKimlik = (tc) => {
@hakanersu
hakanersu / send_sms.rb
Created Feb 24, 2020
Bulutfon Ruby ile SMS gönderimi
View send_sms.rb
require 'json'
require 'rest-client'
url = 'http://api.bulutfon.com/v2/sms/messages?apikey=APIKEY'
payload = {
title: "FIRMA",
content: "Hesabınıza girişte kullanacağınız kod: xxxx",
"receivers": ["905xxxxxxxx"],
View Redirector.json
{
"createdBy": "Redirector v3.2",
"createdAt": "2019-09-01T18:25:22.996Z",
"redirects": [
{
"description": "stackoverflow",
"exampleUrl": "https://i.stack.imgur.com/EdUwb.png",
"exampleResult": "https://proxy.duckduckgo.com/iu/?u=https://i.stack.imgur.com/EdUwb.png",
"error": null,
"includePattern": "https://i.stack.imgur.com/*",
View nginx.conf
# Nginx symlink problemi otomatik deploymentlarda yasana problemin cozumu ve guzel bir aciklamasi.
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
## https://github.com/zendtech/ZendOptimizerPlus/issues/126#issuecomment-24020445
View test.bash
function ydl()
{
youtube-dl --extract-audio --audio-format mp3 "$@" --ignore-errors
}
# youtube-dl: https://rg3.github.io/youtube-dl/
# ornek: ydl "https://www.youtube.com/playlist?list=PL55713C70BA91BD6E"
@hakanersu
hakanersu / wsl-uzerinde-zsh.md
Last active Jan 25, 2018
oh-my-zsh on WSL on hyper
View wsl-uzerinde-zsh.md

Installing Zsh, Ohmyzsh and setting Hyper on WSL

After installing wsl you wont have curl or git so i guess you can figure out and i guess you know about hyper.is.

Install Zsh

sudo apt-get install zsh

Install Oh My Zsh

You can’t perform that action at this time.