Skip to content

Instantly share code, notes, and snippets.

View badursun's full-sized avatar
🎯
Focusing

Anthony Burak DURSUN badursun

🎯
Focusing
View GitHub Profile
@lucashungaro
lucashungaro / mysql - kill all sleeping connections
Created August 11, 2010 13:20
MySQL - kill command for all idle queries
SELECT GROUP_CONCAT('kill ',id SEPARATOR '; ') AS kill_list
FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE command='Sleep';
@dciccale
dciccale / reset.css
Created May 18, 2011 13:09
One-line CSS Reset
*{margin:0;padding:0;outline:0;font-size:1em;font-weight:normal;font-style:normal;border:0;text-decoration:none;list-style-type:none}
@gwobcke
gwobcke / stripStringHTML.asp
Created June 15, 2011 13:51
Classic ASP Strip HTML Function
<%
FUNCTION stripHTML(strHTML)
Dim objRegExp, strOutput, tempStr
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|n)+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with &lt; and &gt;
@gwobcke
gwobcke / checkIfInArray.asp
Last active October 4, 2022 12:42
Classic ASP Check If In Array
<%
Function in_array(element, arr, performTrim)
Dim i
in_array = False
For i=0 To Ubound(arr)
If performTrim Then '//there are some scenarios where you want to trim
If Trim(arr(i)) = Trim(element) Then
in_array = True
Exit Function
End If
@addyosmani
addyosmani / jQueryPluginPatterns.js
Created August 31, 2011 18:02
jQuery Plugin Patterns
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns
@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" />
'//
@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()
@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');
/*
* 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($){
@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]>