Skip to content

Instantly share code, notes, and snippets.

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active May 30, 2025 22:04
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@roundand
roundand / OpenWithSublimeText3.bat
Last active July 1, 2025 06:05 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@ritch
ritch / ex.js
Last active September 6, 2023 04:27
What is the best way to document complex / dynamic objects as arguments to a function?
/**
* Below are several examples of methods that are difficult to clearly annotate with JSDoc annotations.
*/
/**
* @param {Object} people An index of people keyed by a person's name
* @returns {Object} map An index of zipcodes keyed by a person's name
*/
function find(people) {
@jj1bdx
jj1bdx / sleep5.sh
Created June 2, 2014 04:02
A shell one-liner for an infinite loop (sh/zsh/bash compatible)
while true; do date; sleep 5; done
@psymeon
psymeon / inViewport.js
Created September 3, 2014 12:40
Simple jQuery function that determines whether DOM element is in the browser's viewport.
// Custom jQuery function.
// Determines if element is withing the viewport.
$.fn.inViewport = function() {
$el = this;
var elTop = $el.offset().top;
var elBot = elTop + $el.outerHeight(true);
var winScrollTop = $(window).scrollTop();
var winHeight = $(window).height();
var inViewport = winScrollTop <= elBot && (winScrollTop + winHeight) >= elTop;
return inViewport;
@addyosmani
addyosmani / README.md
Last active July 2, 2025 14:29 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@ahmedam55
ahmedam55 / gist:183ac065be9b7dd2ce5f
Created January 2, 2015 13:14
SPA problem with setIntervals and animation
for(var i=0;i<99999;i++){
clearInterval(i);
clearTimeout(i);
}
anonymous
anonymous / index.html
Created February 21, 2015 20:16
JS Bin Custom Directive Chart // source http://jsbin.com/cafapi
<!DOCTYPE html>
<html ng-app="chart">
<head>
<meta name="description" content="Custom Directive Chart">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
label{
width:55px;
@jonobr1
jonobr1 / auto-capture.scpt
Last active September 6, 2024 19:20
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat