Skip to content

Instantly share code, notes, and snippets.

View taimursaeed's full-sized avatar

Taimur Saeed taimursaeed

View GitHub Profile
@taimursaeed
taimursaeed / test.json
Created September 20, 2023 12:35
test json
This file has been truncated, but you can view the full file.
@taimursaeed
taimursaeed / quoteEscaping.js
Created January 21, 2022 14:05
Escape/Unescape quotes from a string
var utility = {
escapeDoubleQuotes: function (string) {
return string.replace(/"/g, """);
},
unescapeDoubleQuotes: function (string) {
return string.replace(/"/g, '"');
},
escapeSingleQuotes: function (string) {
return string.replace(/'/g, "'");
@taimursaeed
taimursaeed / choco.bat
Last active July 29, 2021 06:29
Programs from chocolatey for initial windows setup
:: Run in Command Prompt (cmd.exe) [admin mode]
:: This script will install both the Chocolately .exe file and add the
:: choco command to your PATH variable
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco upgrade -y chocolatey
choco install -y googlechrome
choco install -y firefox
choco install -y figma
choco install -y zeplin
@taimursaeed
taimursaeed / git.txt
Last active December 16, 2020 16:35
Everything related to Git
// Delete local branches that are no longer present on remote
git branch --v | ? { $_ -match "\[gone\]" } | % { -split $_ | select -First 1 } | % { git branch -D $_ }
@taimursaeed
taimursaeed / script.js
Created March 21, 2020 07:39
Wait for CSS animation to complete
// wait for css animation to complete
$(".class").on(
"animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",
function() {
$(this).css({
//do stuff
});
}
);
@taimursaeed
taimursaeed / script.js
Created March 20, 2020 09:53
Wait for CSS transition to complete
// wait for css transition to complete
$(".class").on(
"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",
function() {
$(this).css({
//do stuff
});
}
);
@taimursaeed
taimursaeed / .htaccess
Last active March 18, 2020 15:45
Leverage browser cache and server compression
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@taimursaeed
taimursaeed / touchCSSQueries.css
Last active March 13, 2020 07:47
Target Touch Screens Via CSS Queries
@media (pointer: none), (pointer: coarse) {
}
//via https://stackoverflow.com/a/50302305/4882234
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
/* ... */
}
@taimursaeed
taimursaeed / SearchEverything.ahk
Created November 18, 2019 12:14 — forked from Onurtag/ExploreEverything.ahk
Search from current explorer folder, desktop and taskbar using Everything
#SingleInstance Force
#NoTrayIcon ;Delete this line if you want the tray icon to be visible.
EverythingPath := "C:\Program Files\Everything\Everything.exe" ;If your everything.exe isn't here, fix that. Keep the quotes.
MyUsername := "MyUserName" ;Go to %userprofile% and change this to the title of that window. Keep the quotes.
MyRecycleBin := "Recycle Bin" ;Go to your Recycle Bin and change this to the title of that window. Keep the quotes.
MyThisPC := "This PC" ;Go to your This PC and change this to the title of that window. Keep the quotes.
;You can delete below blocks if you don't want the features. Replace ^F with F3 if you are using that instead.
@taimursaeed
taimursaeed / shortkeys.ahk
Last active November 5, 2019 11:31
My Autohotkey Shortcuts for PC
^!d::RUN,"C:\Users\PC\Downloads"
^!n::RUN,"Notepad"
^!1::RUN,"Chrome"
^!2::RUN,"C:\Program Files\Mozilla Firefox\firefox.exe"
^!3::RUN,"C:\Program Files\Internet Explorer\iexplore.exe"
^!4::Run microsoft-edge:https://autohotkey.com
^!0::RUN,"C:\Program Files\Sublime Text 3\sublime_text.exe"
^SPACE:: Winset, Alwaysontop, , A
#$WheelUp::
Send {Volume_Up}