A Pen by Hakim El Hattab on CodePen.
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
/** Class to produce Fibonacci series and actions on them */ | |
class Fibonacci { | |
/** | |
* Initialize the arrays to store the Fibonacci series | |
* complete: All the values that have been calculated across uses | |
* current: The current list of values | |
*/ | |
constructor() { | |
this.series = { | |
complete: [], |
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 that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers | |
* @param arr The array to flatten | |
* @param removeNonItems A flag to remove `undefined` and `null` values if set to true | |
* | |
* @returns Array | |
*/ | |
function flatten(arr, removeNonItems = false) { | |
var nested = false; |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 13, | |
// font family with optional fallbacks | |
fontFamily: '"Meslo LG L DZ", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
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
import { isArray } from './utils'; | |
export default function flattenArray(arr) { | |
// Use Array.reduce to get our result | |
let flattened = arr.reduce(function(current, item) { | |
// Store a reference to the current item | |
let temp = item; | |
// Check if the item is an array |
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
// Add this to your user keybindings file | |
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context": | |
[ | |
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, | |
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true }, | |
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9`]$", "match_all": true }, | |
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.backtick", "match_all": true } | |
] | |
}, |
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
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' | |
killall Dock |
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
<select name="State"> | |
<option value="" selected="selected">Select a State</option> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> |
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
@mixin _position($position, $args) { | |
$offsets: top right bottom left; | |
@each $o in $offsets { | |
$i: index($args, $o); | |
@if $i | |
and $i + 1 <= length($args) | |
and type-of( nth($args, $i + 1) ) == number { | |
#{$o}: nth($args, $i + 1); | |
} |
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
body{ | |
-webkit-backface-visibility: hidden; | |
-webkit-transform:translate3d(0,0,0); | |
} |
NewerOlder