Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Bojan Vidanovic bojanvidanovic

🎯
Focusing
View GitHub Profile
@bendc
bendc / raf-basic-animation.js
Created Aug 24, 2017
rAF tutorial: basic animation
View raf-basic-animation.js
const element = document.querySelector("span");
const finalPosition = 600;
const time = {
start: performance.now(),
total: 2000
};
const tick = now => {
time.elapsed = now - time.start;
View hugo_seo.html
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/>
<meta name="robots" content="noodp"/>
<link rel="canonical" href="{{ .Permalink }}" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
<meta name="twitter:title" content="{{ .Title }}{{ if .IsHome }} - {{ .Site.Params.Tagline }}{{ else }} - {{ .Site.Title }}{{ end }}" />
<meta name="twitter:site" content="{{ .Site.Params.twitter }}" />
<meta name="twitter:creator" content="{{ .Site.Params.twitter }}" />
@danidiaz
danidiaz / netrw.txt
Created Oct 7, 2016
Vim's netrw commands.
View netrw.txt
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
@Arinerron
Arinerron / permissions.txt
Last active May 24, 2021
A list of all Android permissions...
View permissions.txt
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@bendc
bendc / .vimrc
Last active Oct 11, 2018
Vim config
View .vimrc
set nocompatible
set encoding=utf-8 nobomb
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Plugin 'VundleVim/Vundle.vim'
@habovh
habovh / Wunderground icon names
Created Jan 13, 2016
Wunderground icon names returned by the API, in case you handle your own icons that do not have the same name for example.
View Wunderground icon names
chanceflurries
chancerain
chancesleet
chancesleet
chancesnow
chancetstorms
chancetstorms
clear
cloudy
flurries
@vinaygopinath
vinaygopinath / place-autocomplete.css
Last active Aug 15, 2018
Google maps location/place suggestions with Angular material autocomplete (md-autocomplete) https://plnkr.co/edit/dITwTF?p=preview
View place-autocomplete.css
/*
Optional adjustments for md-autocomplete in mobile screens
*/
#place-autocomplete > md-autocomplete md-input-container {
margin-top: -10px;
}
/*Media query for tablets and above */
@gokulkrishh
gokulkrishh / media-query.css
Last active Jun 16, 2021
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@davidhund
davidhund / accessible-svg-sprite-icons.md
Last active May 10, 2018
Figuring out the most robust, accessible markup for SVG Sprite Icons
View accessible-svg-sprite-icons.md

(as a reply to: https://css-tricks.com/svg-use-with-external-reference-take-2/)

While I love SVG (sprites) there are a lot of issues to take into account.

Advocating The Most Accessible Markup

UPDATE: you should take a look at https://dl.dropboxusercontent.com/u/145744/accessible-svg-icon/test.html which seems a simpler and more robust approach

Another thing: since people copy-paste our code examples it would be great if we could advocate the most robust and accessible markup IMO. I am no a11y expert, but in my understanding we could/should take some extra steps to make out SVG sprite icons more accessible.

@paulirish
paulirish / what-forces-layout.md
Last active Jun 16, 2021
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent