Skip to content

Instantly share code, notes, and snippets.

View kaerer's full-sized avatar
🍀
Life goes on.

Erce Erözbek kaerer

🍀
Life goes on.
View GitHub Profile
@rodrigoespinozadev
rodrigoespinozadev / myservice
Created January 13, 2019 07:12 — forked from bramus/myservice
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@yasinkuyu
yasinkuyu / paribu_api
Last active November 15, 2022 20:02
Paribu Bitcoin Rates
Paribu.com - Türkiye'nin Bitcoin Borsası
2021 (update)
Api endpoint
https://v3.paribu.com/app/markets/btc-tl?interval=1000
Ticker
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active April 24, 2024 12:51
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@jimmygle
jimmygle / PHP-Recursive-Implosion.php
Last active June 20, 2024 22:01
PHP function to recursively implode multi-dimensional arrays.
<?php
/**
* Recursively implodes an array with optional key inclusion
*
* Example of $include_keys output: key, value, key, value, key, value
*
* @access public
* @param array $array multi-dimensional array to recursively implode
* @param string $glue value that glues elements together