Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View uurtech's full-sized avatar
✈️
Works

Ugur KAZDAL uurtech

✈️
Works
View GitHub Profile
@anamorph
anamorph / check_unattached_EIPs.sh
Created January 8, 2024 08:59
[aws] List all the Unattached Elastic IP addresses in all of the Opted-In Regions
#!/bin/sh
# id: check_unattached_EIPs.sh
# author: nicolas david - nicolas@openlab.fr
#
## version history:
# ----------------------------------------------------------------------------
# v1.0 nicolas@ Initial Version
#
# ----------------------------------------------------------------------------
@uurtech
uurtech / test.js
Created January 3, 2024 20:28
Js Object Countries with Flag Emoji
const countries = [
{ name:"Åland Islands" ,code:"+358", flag: "🇦🇽" },
{ name:"Albania" ,code:"+355", flag: "🇦🇱" },
{ name:"Algeria" ,code:"+213", flag: "🇩🇿" },
{ name:"American Samoa" ,code:"+1684", flag: "🇦🇸" },
{ name:"Andorra" ,code:"+376", flag: "🇦🇩" },
{ name:"Angola" ,code:"+244", flag: "🇦🇴" },
{ name:"Anguilla" ,code:"+1264", flag: "🇦🇮" },
{ name:"Antigua & Barbuda" ,code:"+1268", flag: "🇦🇬" },
{ name:"Argentina" ,code:"+54", flag: "🇦🇷" },
@uurtech
uurtech / app.py
Created May 21, 2023 18:08
Delete Older Versions of Bucket files
import boto3
import json
# Configure the AWS SDK with your credentials
session = boto3.Session(
aws_access_key_id='ACCESS_KEY',
aws_secret_access_key='ACESS_SECRET_ACCESS_KEY',
region_name='eu-west-1' # Replace with your desired region
)
@uurtech
uurtech / kubernetes.sh
Created June 24, 2022 06:39
Delete all Kubernetes resources in all namespaces
kubens | while read line ; do
kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found --namespace $line
done
@uurtech
uurtech / that.sh
Created May 16, 2020 07:37
Replace html tag recursively on linux
find . -type f -not -path '*/\.*' -exec sed -i -e "s@<base href=\"\/\/www.mydomain.com.\"\/>@\/@" {} \;
@uurtech
uurtech / controller.go
Created March 22, 2020 14:31
Return Http Response and then Perform other tasks
package main
import (
"fmt"
"net/http"
"sync"
"time"
)
func ping(w http.ResponseWriter, r *http.Request) {
@uurtech
uurtech / script.groovy
Created February 28, 2020 16:41
Delete Old Builds Jenkins Script
//you can go to Manage Jenkins > Script Console
import jenkins.model.Jenkins
import hudson.model.Job
MAX_BUILDS = 55
Jenkins.instance.getAllItems(Job.class).each { job ->
println job.name
def recent = job.builds.limit(MAX_BUILDS)
for (build in job.builds) {
@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.
}
@egulhan
egulhan / calling-traits-contruct-method.php
Last active April 4, 2019 11:23
How to call trait's construct method in PHP
<?php
namespace App\Models\Campaign;
use Illuminate\Database\Eloquent\Model;
use App\Classes\Traits\SetModelConnectionToSlave;
class CampaignDiscount extends Model
{
use SetModelConnectionToSlave {
gitter(){
git add $1
echo "Enter Your Git Commit";
read commitMessage
git commit -m "$commitMessage"
echo "Enter Your Branch"
read branch