Skip to content

Instantly share code, notes, and snippets.

View tolgahanuzun's full-sized avatar
🤖
Exterminatedddddd

Tolgahan ÜZÜN tolgahanuzun

🤖
Exterminatedddddd
View GitHub Profile
@oderwat
oderwat / capollama.go
Last active October 26, 2024 20:11
A simple image captioning program using Ollama v0.4.0-rc with the 'x/llama3.2-vision' model.
package main
import (
"context"
"fmt"
"log"
"os"
"path/filepath"
"strings"
@tolgahanuzun
tolgahanuzun / app.py
Last active September 4, 2019 12:58
In #Spotify, I wrote a tiny #python script to add my favorite songs to a list. You can create your own list by taking your own app and oauth information.
import sys
import spotipy
import spotipy.util as util
scope = 'user-library-read playlist-modify-private'
if len(sys.argv) > 1:
username = sys.argv[1]
playlist_name = sys.argv[2]
else:
@tanaikech
tanaikech / submit.md
Last active April 26, 2025 03:48
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

News

At October 11, 2019, I published a Javascript library to to run the resumable upload for Google Drive. When this is used, the large file can be uploaded. You can also use this js library.

Description

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
  • Before you use this, please enable Drive API at API console and carr
@buxx
buxx / aiopoc.py
Created July 24, 2018 12:44
aiohttp stream response example
from aiohttp import web
async def handle(request):
response = web.StreamResponse(
status=200,
reason='OK',
headers={'Content-Type': 'text/plain'},
)
await response.prepare(request)
from base64 import b64encode, b64decode
from hashlib import sha256
import hmac
import json
import twitter
import os
import boto3
lex = boto3.client('lex-runtime')
CONSUMER_KEY = os.getenv('CONSUMER_KEY')
@evgeniy-trebin
evgeniy-trebin / brew_elasticsearch.sh
Last active September 21, 2022 22:39
How to install specific version of elasticsearch via brew
brew tap homebrew/versions
brew cask install java
brew search elasticsearch
brew install [email protected]
brew services start [email protected]
@montanaflynn
montanaflynn / pget.go
Last active January 17, 2025 17:07
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@emir
emir / challenge.md
Last active November 7, 2016 12:07
Medium Challenge (Kasım)
@groob
groob / deploy.go
Last active December 21, 2022 03:39
/*
HookHandler - listen for github webhooks, sending updates on channel.
DeploymentMonitor select update type based on channel and call deployment script
*/
package main
import (
"fmt"
"html/template"
"io/ioutil"
@bradmontgomery
bradmontgomery / example.py
Created August 16, 2016 16:57
Example of setting a choices value for django ArrayField
# Here's your list of choices that would be displayed in a drop-down
# element on the web. It needs to be a tuple, and we define this
# as a variable just for readability/convenience.
#
# This example has 3 choices, each of which consists of two parts:
# 1. the thing that get strored in your database
# 2. the thing that you see in a dropdown list
LABEL_CHOICES = (
('this gets stored in your database', 'This item is what you see in the drop-down'),
('django', 'Django'),