List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
[keys.normal] | |
C-f = [":new", ":insert-output lf-pick", ":theme default", "select_all", "split_selection_on_newline", "goto_file", "goto_last_modified_file", ":buffer-close!", ":theme tokyonight_storm"] |
var i = performance.now(); | |
yourFunction(); | |
performance.now() - i; | |
//Or make a helper function, like this: | |
function performanceTest(testFunction, iterations) { | |
'use strict'; | |
var sum = 0; | |
var start = performance.now(); | |
for (var i = 0; i < iterations; i++) { |
Visit the new improved script here! Smooth scroll to top of page (Improved!)
If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.
<body>
tag. Like this: <body id="top">
onclick
function to the link. Like this: <a href="#top" onclick="scrollToTop(); return false">Back to Top ↑</a>
// Media queries breakpoints | |
// -------------------------------------------------- | |
// Extra small screen / phone | |
$screen-xs ?= 480px | |
$screen-phone ?= $screen-xs | |
// Small screen / tablet | |
$screen-sm ?= 768px | |
$screen-tablet ?= $screen-sm |
You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":
Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |