Skip to content

Instantly share code, notes, and snippets.

View badursun's full-sized avatar
🎯
Focusing

Anthony Burak DURSUN badursun

🎯
Focusing
View GitHub Profile
@lorddev
lorddev / AntiForgeryTokenValidator.asp
Last active May 23, 2024 17:59
Classic ASP version of ASP.NET MVC AntiForgeryToken validator
<%
' Use with a very short session (basically the page lifecycle, GET then POST)
Class AntiForgeryValidator
Private m_securityToken
Sub SetCookie()
m_securityToken = CreateWindowsGuid()
Response.Cookies("RequestVerificationToken") = m_securityToken
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 24, 2025 23:08
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@iredun
iredun / youtube.txt
Created April 13, 2016 08:59
Youtube API get thumbnail image
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
@ahmetkakici
ahmetkakici / google-taxonmy.sql
Created October 9, 2017 19:45
Google Product Taxonomy - SQL script
INSERT INTO categories (parent_id, name, id) VALUES (null, 'Bavullar ve Çantalar', 5181);
INSERT INTO categories (parent_id, name, id) VALUES (5181, 'Alışveriş Çantaları', 5608);
INSERT INTO categories (parent_id, name, id) VALUES (5181, 'Bavul Aksesuarları', 110);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Bagaj Rafları ve Sehpaları', 499691);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Bavul Düzenleyicileri', 5620);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Bavul Etiketleri', 5651);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Bavul Kayışları', 5652);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Bavul Örtüleri', 7521);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Korumalı Kap Düzenleyicileri ve Bölme Ekleri', 503014);
INSERT INTO categories (parent_id, name, id) VALUES (110, 'Seyahat Keseleri', 5650);
@adinan-cenci
adinan-cenci / _fetch-form.md
Last active May 13, 2025 12:58
How to follow upload progress with fetch()

How can we follow the upload progress with fetch() ?

Simple: We can't.
Not right now anyway, fetch() does not support that, but good old XMLHttpRequest does though.

The function below behaves much like fetch(), it will return a Promise that will resolve into a Response object.

Just pass a progress function in the options parameter.