Skip to content

Instantly share code, notes, and snippets.

View uurtech's full-sized avatar
✈️
Works

Ugur KAZDAL uurtech

✈️
Works
View GitHub Profile
@uurtech
uurtech / Delete Slack Message Tool
Created July 6, 2019 12:52
Delete All Slack Messages as a Service
This is just a description of how to use Slack Message Tool,
You can backup and delete all the Slack messages at once with this easy app. Just choose what to do and our amazing magic will do that job for you.
https://www.messagebender.com/
@uurtech
uurtech / gist:956a4fe8d74a6668843f69552ecf3f2f
Created September 17, 2019 15:11
Install app to server (nginx config)
#/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;
}
#/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"
String.prototype.cleaner = function(){
return this.replace(/\t|\n|\r|:|\s/g,'');
}
"ugur kazdal \t\t".cleaner();
outputs : ugurkazdal
Array.prototype.cleaner = function(){
return this.filter(n => n)
}
var arr = ["asd","","aa"];
console.log(arr.cleaner());
//"asd","aa"
@uurtech
uurtech / gist:db491c071d4ead207683b44ed065b734
Created December 5, 2019 18:13
run crontab file immediatly
crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done
#thanks to Django Janny on Stackoverflow
@uurtech
uurtech / docker-compose.yml
Created December 29, 2019 15:44
Apache mysql adminer docker container with same network
version: "3"
services:
web:
build: ./web/
volumes:
- ./app/:/var/www/html/
ports:
- 8000:80
networks:
@uurtech
uurtech / scrollevent.js
Created December 30, 2019 11:30
Scroll Check by time.
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 / prototypes.ts
Last active December 31, 2019 10:08
Typescript strip tags and full trim string prototype
declare global {
interface String {
fullTrim();
strip();
cleanQuotas();
cleanCommas();
floatReplacer();
cleanHtmlChars();
}
interface Object {
@uurtech
uurtech / main.go
Last active January 17, 2020 17:15
Encode Bytes of Json String with omiting empty fields
//delete the key if valueOf type is empty
reader := strings.NewReader(string(message))
// writer := os.Stdout
dec := json.NewDecoder(reader)
// enc := json.NewEncoder(writer)
for {
var m map[string]interface{}
if err := dec.Decode(&m); err == io.EOF {
break
} else if err != nil {