Skip to content

Instantly share code, notes, and snippets.

🎧
Focused

Ugur KAZDAL uurtech

🎧
Focused
Block or report user

Report or block uurtech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@uurtech
uurtech / main.go
Created Jan 14, 2020
JSON unmarshalJson Timestamp to ISO Date
View main.go
package main
import (
"encoding/json"
"fmt"
"strconv"
"time"
)
type CustomTime struct {
@uurtech
uurtech / scrollevent.js
Created Dec 30, 2019
Scroll Check by time.
View scrollevent.js
let tempTimeStamp = 0;
window.addEventListener('scroll', function (event) {
if(((event["timeStamp"] - tempTimeStamp) / 1000) < 5){ //how many seconds you rely on.
tempTimeStamp = event["timeStamp"];
}else{
console.log(( event["timeStamp"] - tempTimeStamp) / 1000)
tempTimeStamp = event["timeStamp"];
//use withinviewport in here.
}
@uurtech
uurtech / docker-compose.yml
Created Dec 29, 2019
Apache mysql adminer docker container with same network
View docker-compose.yml
version: "3"
services:
web:
build: ./web/
volumes:
- ./app/:/var/www/html/
ports:
- 8000:80
networks:
@uurtech
uurtech / prototypes.ts
Last active Dec 31, 2019
Typescript strip tags and full trim string prototype
View prototypes.ts
declare global {
interface String {
fullTrim();
strip();
cleanQuotas();
cleanCommas();
floatReplacer();
cleanHtmlChars();
}
interface Object {
View gist:db491c071d4ead207683b44ed065b734
crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done
#thanks to Django Janny on Stackoverflow
View Array Prototype Filter Clean empty strings
Array.prototype.cleaner = function(){
return this.filter(n => n)
}
var arr = ["asd","","aa"];
console.log(arr.cleaner());
//"asd","aa"
View Javascript Regex Clean Tabs, NewLines, Spaces prototype
String.prototype.cleaner = function(){
return this.replace(/\t|\n|\r|:|\s/g,'');
}
"ugur kazdal \t\t".cleaner();
outputs : ugurkazdal
View gist:b34689ad03457783147cccde76d8c7db
#/bin/bash
ssh user@IP "cd /var/www; git pull https://GIT_REPO_WITH_TOKEN; cd /var/www; npm install ; npm run build ;pm2 delete APP_NAME ; pm2 start index --name APP_NAME"
@uurtech
uurtech / gist:956a4fe8d74a6668843f69552ecf3f2f
Created Sep 17, 2019
Install app to server (nginx config)
View gist:956a4fe8d74a6668843f69552ecf3f2f
#/bin/bash
ssh user@IP " echo 'server {
listen 80;
server_name sysmon.tecmint.lan;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:5000;
}
View gist:f9003bccf8adf3e451fb5b8d08df3dc8
[
{ "uni" : "Abdullah Gül Üniversitesi" },
{ "uni" : "Adana Alparslan Türkeş Bilim ve Teknoloji Üniversitesi" },
{ "uni" : "Adıyaman Üniversitesi" },
{ "uni" : "Afyon Kocatepe Üniversitesi" },
{ "uni" : "Afyonkarahisar Sağlık Bilimleri Üniversitesi" },
{ "uni" : "Akdeniz Üniversitesi" },
{ "uni" : "Aksaray Üniversitesi" },
{ "uni" : "Alanya Alaaddin Keykubat Üniversitesi" },
{ "uni" : "Amasya Üniversitesi" },
You can’t perform that action at this time.