If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:
var component = <Component foo={x} bar={y} />;
Mutating Props is Bad, mkay
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font-size: 100%; |
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="MyProject"> | |
<description>PSR-2 plus extras</description> | |
<rule ref="PSR2" /> | |
<!-- Verifies that class members have scope modifiers. --> | |
<rule ref="Squiz.Scope.MethodScope" /> | |
<!-- Discourages the use of deprecated functions that are kept in PHP |
@ECHO OFF | |
REM Remove registry if any | |
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /f | |
REM Get WebStorm executable path | |
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CLASSES_ROOT\Applications\WebStorm.exe\shell\open\command"`) DO ( | |
SET WEBSTORM=%%A %%B | |
) |
(function ($) { | |
$(document).ready(function () { | |
$('#next').click(function () { | |
$.post( | |
PT_Ajax.ajaxurl, | |
{ | |
// wp ajax action | |
action: 'ajax-inputtitleSubmit', | |
// vars |
@echo off | |
REM If PowerShell 2 is not installed, this script will automatically download and install it. | |
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers. | |
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/ | |
ver | find "XP" > nul | |
if %ERRORLEVEL% neq 0 goto not_xp | |
ver | find "5.1.2600" > nul |
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install composer | |
brew install homebrew/php/composer | |
### PHPCS | |
composer global require "squizlabs/php_codesniffer=*" | |
# Add to your .bash_profile |
// App | |
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app', | |
template: '<span>{{ sayHello() }}</span>', | |
}) | |
export class App { | |
public name: string = 'John'; |
# http://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection | |
namespace :db do | |
desc "Fix 'database is being accessed by other users'" | |
task :terminate => :environment do | |
ActiveRecord::Base.connection.execute <<-SQL | |
SELECT | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE |
var elements = document.querySelectorAll("div"), | |
callback = (el) => { console.log(el); }; | |
// Spread operator | |
[...elements].forEach(callback); | |
// Array.from() | |
Array.from(elements).forEach(callback); | |
// for...of statement |