Skip to content

Instantly share code, notes, and snippets.

View hto's full-sized avatar
👀
./hto

Halil Tuğcan Özaktaş hto

👀
./hto
View GitHub Profile
AWSTemplateFormatVersion: '2010-09-09'
Description: Example StackSet
Resources:
DynamoDBGlobalTable:
Type: AWS::DynamoDB::GlobalTable
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
AWSTemplateFormatVersion: '2010-09-09'
Transform: "AWS::Serverless-2016-10-31"
Description: ExampleStack - v.1
Parameters:
DynamoTableName:
Type: "String"
ExampleLambdaFunction:
Type: AWS::Lambda::Function
@hto
hto / localization.js
Created March 3, 2020 19:39
Javascript simple localization methods
module.exports = {
currentLang: 'en',
textList: null,
setLang: function(lang) {
this.currentLang = lang;
this.textList = require(lang);
},
__t: function(key) {
return typeof this.textList[key] === "undefined" ? "-" : this.textList[key];
},
@hto
hto / main.go
Created October 22, 2019 18:47
package main
import (
"flag"
"fmt"
. "github.com/hto/redis-memory-analysis"
)
var (
Key Count Size
users:data:* 109270 832.476 MB
users:products:pid:* 1410800 784.237 MB
users:inbox:* 593842 761.199 MB
users:energy:* 1176558 532.499 MB
customer:bundle:* 1417628 511.679 MB
users:packages:* 314613 426.036 MB
toma:* 1015310 323.098 MB
hto:power:* 869738 309.491 MB
users:powers:* 1404458 297.675 MB
@hto
hto / regex.creditcard.md
Last active April 28, 2019 18:56
Regex All Credit Card Validation

Remove all , and - and other non-digits from the string first. Then use this regex that matches Visa, MasterCard, American Express, Diners Club, Discover, and JCB cards:

https://stackoverflow.com/questions/9315647/regex-credit-card-number-tests

Code

^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$
@hto
hto / MainActivity.java
Last active September 2, 2019 14:23
React Native Wix Navigation V2 - Android Navigation Buttons Bar Hide - HTC - Nexus - FullScreen
package com.example.app;
import com.reactnativenavigation.NavigationActivity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends NavigationActivity {
@hto
hto / # php - 2019-01-02_20-09-45.txt
Created January 3, 2019 07:07
php on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for php on macOS 10.13.6
Build date: 2019-01-02 20:09:45
İlk satırım - İkinci satırım - Üçüncü satırım - Son Satır
echo "İlk satırım - ";
echo "İkinci satırım - ";
echo "Üçüncü satırım - ";
goto a;
echo "Beşinci satırım - ";
echo "Altıncı satırım - ";
a:
echo "Son Satır";