Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
// @return Promise<boolean> | |
async function askWritePermission() { | |
try { | |
// The clipboard-write permission is granted automatically to pages | |
// when they are the active tab. So it's not required, but it's more safe. | |
const { state } = await navigator.permissions.query({ name: 'clipboard-write' }) | |
return state === 'granted' | |
} catch (error) { | |
// Browser compatibility / Security error (ONLY HTTPS) ... | |
return false |
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
[push] | |
default = simple | |
[alias] | |
tree = log --graph --full-history --all --color --date=short --pretty=format:\"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset\" | |
co = checkout | |
s = status | |
b = branch | |
cm = commit -m | |
add-cm = "!git add -A && git commit -m" | |
p = pull --rebase |
type FilterOperator = 'AND' | 'OR'; | |
type FiltersBy<T> = { | |
[K in keyof T]?: (value: T[K]) => boolean; | |
}; | |
/** | |
* Factory function that creates a specialized function to filter | |
* arrays, by validating all filters (AND operator), | |
* or validating just one of the filters (OR operator). | |
* @param operator Method to validate all filters: AND, OR |
import config from '../config' | |
let components = {} | |
//For each component in the config fiel into an object | |
for (var i = config.length - 1; i >= 0; i--) { | |
components[config[i].name] = require(config[i].path).default | |
} | |
export default components |
Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
$(document).ready(function(){ | |
// queryStrip | |
function queryStrip(string) { | |
string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
var regex = new RegExp('[\\?&]' + string + '=([^&#]*)'), | |
results = regex.exec(location.search); | |
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, '')); | |
} |
<?php | |
add_action( 'wp_head', 'add_screenshot_as_ogimage' ); | |
function add_screenshot_as_ogimage(){ | |
// default width = 1500 -- 200px minimum, Facebook recommends 1500x1500, max image size of 5mb | |
echo '<meta property="og:image" content="http://s.wordpress.com/mshots/v1/'.urlencode( $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ).'?w=1500"/>'; |
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |