Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.
- Go to
settings
. - Search for
live templates
. - Under the javascript section you should be able to manage your templates.
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
#!/bin/sh | |
# .git/hooks/post-checkout | |
# chmod +x .git/hooks/post-checkout | |
if [ $(git symbolic-ref HEAD | cut -d '/' -f 3) == 'master' ]; then | |
lines[0]="Master, Master, where's the dreams that I've been after?" | |
lines[1]="Master, Master, you promised only lies" | |
lines[2]="Laughter, laughter, all I hear or see is laughter" | |
lines[3]="Laughter, laughter, laughing at my cries" | |
echo " ${lines[$((RANDOM%${#lines[*]}))]}"; |
// console.lol by @RonnyOrbach, idea by Erez Avny | |
if (typeof console != 'undefined') console.lol = function(){ | |
var args = [].slice.call(arguments, 0); | |
args.unshift("LOL"); | |
args.push("LOLOLOL!") | |
console.log.apply(console, args); | |
}; |
Simple Dashing widget to countdown until a certain moment. Flashes the widget when finished.
##Usage
To use this widget, copy countdown.html
, countdown.coffee
, and countdown.scss
into the /widgets/countdown
directory.
To include the widget in a dashboard, add the following snippet to the dashboard layout file:
case '$STATEMENT$': | |
$END$ | |
break; |
Dashing widget to display a bunch of current and coming-up Google Calendar events.
The widget shows only one event and is based on the text-widget which is default in the Dashing installation. The time is displayed as human-readable time string with the help of MomentJS.
A Dashing job fetches the events of a given public or private calendar url, orders events to match starting time and sends the data to the dashboard. A certain event offset can be set for each calendar widget so that it will show the first (data-pre="0"
), the second (data-pre="1"
) or any other following event based on the offset. For each calendar you'll have to define a name which enables you to assign custom background colors for events of each calendar.
While the main job is called in larger intervals, there is a second job to be run every minute or so, which kicks out already finished events. In that way processing load
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
.twitter-typeahead .tt-query, | |
.twitter-typeahead .tt-hint { | |
margin-bottom: 0; | |
} | |
.tt-hint { | |
display: block; | |
width: 100%; | |
height: 38px; | |
padding: 8px 12px; | |
font-size: 14px; |
getReferrerTraits = function() { | |
// Requires: jQuery, jQuery.cookie, segment.io | |
// TODO: Update referralHost:blackList with your domain, so we only track external referrers. | |
var analytics_args = [], | |
analytics_traits, | |
acquisitionSource, | |
firstReferrer, | |
firstCampaign, |