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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
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
// Requires Bourbon | |
@import "bourbon/bourbon"; | |
// Use CSS gradient and text shadow to create line that breaks for descenders | |
// Inspired by https://medium.com/designing-medium/7c03a9274f9 | |
@mixin fancyUnderline( $color: currentColor, $bgcolor: #fff ) { | |
@include background-image( linear-gradient( to bottom, $bgcolor 50%, $color 50% ) ); | |
background-position: 0 89%; | |
background-repeat: repeat-x; | |
background-size: 1px 1px; |
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
# If you don't remember the exact path/name, search the log for deleted files | |
git log --diff-filter=D --summary | grep delete | |
# Find the file you want to get from the ouput, and use the path | |
# Find the commits that involved that path | |
git log --all -- some/path/to/deleted.file | |
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted) | |
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file |
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
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom) | |
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right. | |
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID. | |
// Copy / paste the below script into the JavaScript console. | |
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages). | |
var before = 'LAST_MESSAGE_ID'; | |
clearMessages = function(){ | |
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, ""); | |
const channel = window.location.href.split('/').pop(); |
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
{ | |
"💍":"diamond | engagement ring | diamond ring | diamond rings | diamonds | engagement rings", | |
"🆎":"blood type AB", | |
"❣":"heart", | |
"🇱🇨":"Saint Lucia | Saint Lucian flag", | |
"🇮🇪":"Ireland | Irish flag", | |
"🇨🇮":"Côte d’Ivoire | Ivory Coast | Ivorian flag", | |
"💎":"diamond | gem | gemstone | jewel | diamonds | gems | gemstones | jewels", | |
"☠️":"skull and crossbones | poison | poisonous", | |
"👩💻":"technology worker | tech worker | technologist | techie | IT worker | Apple genius | woman in technology | woman tech worker | woman technologist | woman IT worker | woman in IT | woman Apple genius", |
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
const request = window.indexedDB.open("database", 1); | |
// Create schema | |
request.onupgradeneeded = event => { | |
const db = event.target.result; | |
const invoiceStore = db.createObjectStore("invoices", { keyPath: "invoiceId" }); | |
invoiceStore.createIndex("VendorIndex", "vendor"); | |
const itemStore = db.createObjectStore("invoice-items", { keyPath: ["invoiceId", "row"] }); |
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
// MARK: - Significant location change montioring logic | |
// Called at launch of application if permission is already granted | |
func startMonitoringSignificantLocationChanges() { | |
locationManager.startMonitoringSignificantLocationChanges() | |
} | |
// Called by location manager if there is a significant location change | |
func locationManager(_ manager: CLLocationManager, | |
didUpdateLocations locations: [CLLocation]) { |
OlderNewer