Skip to content

Instantly share code, notes, and snippets.

View senocak's full-sized avatar
🎸
Working from home

Anıl senocak

🎸
Working from home
View GitHub Profile
@dogukancagatay
dogukancagatay / KeyDB with Docker.md
Last active March 27, 2024 07:22
Basic KeyDB Configuration with Docker

KeyDB with Docker

Migration from Redis

Connect to your keydb server new-keydb-server-1

keydb-cli -h new-keydb-server-1
@senocak
senocak / delete.php
Created August 23, 2017 07:33
PDO and verot.net class upload delete
public function sil($tablo,$id){
$eski_resim="";
$query = $this->db->query("SELECT * FROM $tablo where id='$id'")->fetch(PDO::FETCH_ASSOC);
if ($query){
$eski_resim=$query["resim"];
}
unlink("../images/$tablo/$eski_resim");
$stmt = $this->db->prepare("DELETE FROM $tablo WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$sil =$stmt->execute();
@senocak
senocak / update.php
Created August 23, 2017 07:26
PDO and verot.net class upload update
public function duzenle($sutun,$deger,$tablo,$resim,$dizin,$id,$en,$boy){
if($sutun!=""){
$tablo_degerleri=explode("--",$deger);
$tablo_adlari=explode("--",$sutun);
$tablo_degerleri_text="";
for($i=0;$i<count($tablo_adlari);$i++){
$tablo_degerleri_text=$tablo_adlari[$i]."=:".$tablo_adlari[$i].",".$tablo_degerleri_text;
}
}else{
$tablo_degerleri_text="";
@senocak
senocak / insert.php
Created August 23, 2017 07:15
PDO and verot.net class upload insert Contribution settings
<?php
public function ekle($sutun,$deger,$tablo,$resim,$dizin,$en,$boy){
if($sutun!=""){
$tablo_adlari=explode("--",$sutun);
$tablo_degerleri=explode("--",$deger);
$tablo_adlari_text="";
$tablo_degerleri_text="";
for($i=0;$i<count($tablo_adlari);$i++){
$tablo_adlari_text.=$tablo_adlari[$i].',';
$tablo_degerleri_text.=":".$tablo_adlari[$i].",";
@cacheflowe
cacheflowe / remove-twitter-likes.js
Last active January 27, 2024 13:29
Remove your Twitter likes
// [Noted in the comments below on 2023-10 - this script might not work very well anymore due to Elon ruining Twitter]
// [Updated 2021-01-18 w/new selectors]
// go to your account Likes page and run this in the console:
function scrollToLoadMore() {
// keep scrolling if twitter tries to stop loading more.
// scroll up, then down to force infinite load.
window.scrollTo(0, 0);
setTimeout(function() {
window.scrollBy(0, 9999999999);
@artisonian
artisonian / simple_gridfs_server.py
Created July 27, 2010 19:24
A simple GridFS server built with Flask
from flask import Flask, request, redirect, url_for, make_response, abort
from werkzeug import secure_filename
from pymongo import Connection
from pymongo.objectid import ObjectId
from gridfs import GridFS
from gridfs.errors import NoFile
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
DB = Connection().gridfs_server_test
FS = GridFS(DB)