Skip to content

Instantly share code, notes, and snippets.

View badursun's full-sized avatar
🎯
Focusing

Anthony Burak DURSUN badursun

🎯
Focusing
View GitHub Profile
@adinan-cenci
adinan-cenci / _fetch-form.md
Last active June 28, 2024 23:26
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.

@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);
@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:
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 26, 2024 19:09
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

@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
@elidickinson
elidickinson / html_email_buttons_1.html
Last active May 29, 2024 02:15
HTML email buttons that work
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="height:40px;v-text-anchor:middle;width:300px;" arcsize="10%" stroke="f" fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Button Text Here!
</center>
</v:roundrect>
<![endif]-->
<![if !mso]>
/*
* jQuery Double Tap
* Developer: Sergey Margaritov (github.com/attenzione)
* License: MIT
* Date: 22.10.2013
* Based on jquery documentation http://learn.jquery.com/events/event-extensions/
*/
(function($){
@steveosoule
steveosoule / javascript-device-orientation.js
Created June 5, 2013 23:21
JavaScript Device Orientation
// http://daker.me/2013/06/5-html5-javascript-apis-to-keep-an-eye-on.html
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', function(event) {
var a = event.alpha,
b = event.beta,
g = event.gamma;
console.log('Orientation - Alpha: ' + a + ', Beta: '+ b + ', Gamma: ' + g);
}, false);
} else {
console.log('This device does not support deviceorientation');
@radleta
radleta / DateTimeConvert.asp
Created December 10, 2012 12:58
Date and Time conversion local to and from UTC for ASP.
<%
' ****************************************************************************
' Sub: GetUtcOffsetMinutes
' Description: Gets the number of minutes between local time and UTC.
'
' Params: None
' ****************************************************************************
Function GetUtcOffsetMinutes()
@gwobcke
gwobcke / URLDecode.asp
Last active June 21, 2023 09:38
ASP seems to lack a URL Decode function but has a URL Encode function available. Here is a function that can decode any URL Encoded URL or variable.
<%
FUNCTION URLDecoder(str)
'// This function:
'// - decodes any utf-8 encoded characters into unicode characters eg. (%C3%A5 = å)
'// - replaces any plus sign separators with a space character
'//
'// IMPORTANT:
'// Your webpage must use the UTF-8 character set. Easiest method is to use this META tag:
'// <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
'//