NOTE
This has stopped working due to an odd timing issue with a minuscule
-webkit-transition-duration
value firing awebkitTransitionEnd
Checkout a pure CSS version here: https://github.com/rgthree/google-loader-css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* **She grows old and feeble** */ | |
//...But she would always have to return back to her dull world of chores and grown-ups. | |
return function() { | |
// And her latest story would be filled with wonder | |
latestStory = adventures[adventures.length - 1]; | |
// But time is a bitch... | |
setInterval(function() { | |
// and our dear princess can't help but forget her adventures, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Created by Sindre Sorhus | |
# Magically retrieves a GitHub users email even though it's not publicly shown | |
[ "$1" = "" ] && echo "usage: $0 <GitHub username> [<repo>]" && exit 1 | |
[ "$2" = "" ] && repo=`curl "https://api.github.com/users/$1/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | tr -d ' ' | head -n 1` || repo=$2 | |
curl "https://api.github.com/repos/$1/$repo/commits" -s | sed -En 's|"(email\|name)": "(.+)",?|\2|p' | tr -s ' ' | paste - - | sort -u -k 1,1 |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Get Sift3 distance from two words. | |
/// (eg: spell checking) | |
/// </summary> | |
/// <param name="source"> source string </param> | |
/// <param name="actual"> actual string </param> | |
/// <param name="maxOffset"> max offset </param> | |
/// <returns> The distance of the two words. </returns> | |
public static float GetSift3Distance(string source, string actual, int maxOffset) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
angular.module('yourModule').directive('inlineConfirm', | |
['$compile', | |
function ($compile) { | |
return { | |
priority: -100, | |
link: function (scope, elm, attrs) { | |
var wrapperTemplate = '<div class="popover inline-confirm" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'; | |
var template = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import praw | |
import pdb | |
import re | |
import os | |
import time | |
user_agent = ("spread kindness /u/eclecticmiraclecat13") | |
r = praw.Reddit(user_agent=user_agent) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "octokit" | |
gem "nokogiri" | |
gem "json" |