For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');| export interface PackageJSON extends Object { | |
| name: string | |
| version?: string | |
| description?: string | |
| keywords?: string[] | |
| homepage?: string | |
| bugs?: string | Bugs | |
| license?: string | |
| author?: string | Author | |
| contributors?: string[] | Author[] |
| const array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; | |
| Array.from(new Set(array)); |
| #!/bin/bash | |
| function quick-look() { | |
| SCREEN_WIDTH=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1) | |
| SCREEN_HEIGHT=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2) | |
| WIDTH=$(echo $(( ${SCREEN_WIDTH} * 0.75)) | cut -f1 -d".") | |
| HEIGHT=$(echo $(( ${SCREEN_HEIGHT} * 0.75)) | cut -f1 -d".") | |
| feh --title="feh_quicklook" --scale-down --geometry "${WIDTH}"x"${HEIGHT}" $1 $(pwd) >/dev/null 2>&1 | |
| } |
| // simple react component to demonstrate intersection observer API usage | |
| // renders box in red when fully visible otherwise renders in blue | |
| import React, { Component } from 'react'; | |
| class Box extends Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { |
| atom-text-editor.editor { | |
| .syntax--punctuation.syntax--whitespace.syntax--comment.syntax--leading, | |
| .syntax--source { | |
| font-family: FiraCode-Retina; // https://github.com/tonsky/FiraCode | |
| text-rendering: optimizeLegibility; | |
| letter-spacing: 0; | |
| } | |
| .syntax--string.quoted, | |
| .syntax--string.regexp { |
| function instantiate(element) { | |
| const { type, props } = element; | |
| // Create DOM element | |
| const isTextElement = type === "TEXT ELEMENT"; | |
| const dom = isTextElement | |
| ? document.createTextNode("") | |
| : document.createElement(type); | |
| updateDomProperties(dom, [], props); |
| { | |
| "name": "react-redux-boilerplate", | |
| "version": "0.0.1", | |
| "description": "", | |
| "main": "js/app.js", | |
| "dependencies": { | |
| "react": "0.14.6", | |
| "react-dom": "0.14.6", | |
| "react-redux": "^4.4.1", | |
| "redux": "^3.3.1", |
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');| /** | |
| * Parse hash bang parameters from a URL as key value object. | |
| * | |
| * For repeated parameters the last parameter is effective. | |
| * | |
| * If = syntax is not used the value is set to null. | |
| * | |
| * #x&y=3 -> { x:null, y:3 } | |
| * | |
| * @param aURL URL to parse or null if window.location is used |