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 { jsx } = require('slate-hyperscript') | |
| const { JSDOM } = require('jsdom') | |
| const DOMParser = new JSDOM().window.DOMParser | |
| /** | |
| * Parses and returns a Rich Text AST object for use in GraphCMS. | |
| * | |
| * @param {HTML} html string, e.g. `<p>hi there</p>` | |
| */ | |
| const htmlToAST = html => { |
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 * as crypto from 'crypto'; | |
| import * as fs from 'fs'; | |
| import * as path from 'path'; | |
| /** | |
| * Interface for Webpack's hashFunction | |
| */ | |
| export interface IHashFunction { | |
| update: (data: string | Buffer, encoding: string) => IHashFunction; | |
| digest: (encoding: string) => string | Buffer; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>My JavaScript Test</title> | |
| </head> | |
| <body> | |
| <h1 id="page-header"> | |
| Loading... | |
| </h1> | |
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 "bourbon/bourbon"; | |
| @import "colors"; | |
| @import url('https://fonts.googleapis.com/css?family=Inconsolata'); | |
| @import "grid"; | |
| @import "utils"; | |
| $parent_menu_items: 3; | |
| $submenu_menu_items: 4; | |
| html, body { |
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
| $(document).ready(function() { | |
| let menu = $('nav > ul'), | |
| menuLink = $('#mobile-menu a'); | |
| menuLink.on('click', function() { | |
| if (menu.hasClass('closed')) { | |
| menu.removeClass('closed'); | |
| menu.addClass('open'); | |
| } else { |
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> | |
| <nav> | |
| <ul class="closed"> | |
| <li id="mobile-menu" class="mobile-only"> | |
| <a href="#"> | |
| <div id="hamburger"></div> | |
| MENU | |
| </a> | |
| </li> | |
| <li> |
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
| @for $i from 1 through 12 | |
| .col-sm-#{$i} | |
| @include sizer(small) | |
| float: left | |
| width: percentage(($i/12)) | |
| .col-md-#{$i} | |
| @include sizer(medium) | |
| float: left | |
| width: percentage(($i/12)) | |
| .col-lg-#{$i} |
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
| <?php | |
| /* | |
| * Problem 01 | |
| * ========== | |
| * Create an associative array with the following chart data and assign it to a variable named "$chartData". | |
| * The data will be used later and accessed by date string, e.g. echo $chartData["201806"]; // expects 92000 | |
| * | |
| * Monthly company revenue in USD. 201801: 154000, 201802: 165000, | |
| * 201803: 120000, 201804: 130500, | |
| * 201805: 110000, 201806: 92000, |
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
| var data = [ | |
| { | |
| name: 'Bob Smith', | |
| text: 'Hello, I want to eat a pineapple.' | |
| }, | |
| { | |
| name: 'Sally Smith', | |
| text: 'I lit a firework, and it went kabooom!' | |
| }, | |
| { |
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
| // Caesar cipher +2 | |
| var encoded_caesar = "vjg"tckp"kp"urckp"hcnnu"ockpn{"qp"vjg"rnckp"; | |
| // Divisible by 2: +1, Divisible by 3: +3, Divisible by both: -1 | |
| var fancy_cipher = "shf#ne`njqh nf!ojfd jv!41"; |