Skip to content

Instantly share code, notes, and snippets.

@silviogutierrez
silviogutierrez / php.rb
Created June 18, 2012 04:35
PHP 5.2 Formula for Homebrew
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
class Php < Formula
url 'http://ca2.php.net/distributions/php-5.2.17.tar.gz'
homepage ''
md5 '04d321d5aeb9d3a051233dbd24220ef1'
sqltrim ()
{
sed -e '/INSERT INTO `accesslog/d' -e '/INSERT INTO `apachesolr/d' -e '/INSERT INTO `cache/d' -e '/INSERT INTO `migrate_message_/d' -e '/INSERT INTO `search_/d' -e '/INSERT INTO `watchdog/d' $1 > $1.trimmed;
mv $1.trimmed $1
}
<?php
function example_form_element_label($variables) {
$element = $variables['element'];
// This is also used in the installer, pre-database setup.
$t = get_t();
// If title and required marker are both empty, output no label.
if ((!isset($element['#title']) || $element['#title'] === '') && empty($element['#required'])) {
return '';
}
Your markup:
<div class="item">
<h3 class="product">Foo</h3>
<img src="bar" />
</div>
Your CSS:
.item h3.product { do something to add a product icon here }
function decorateEntrySnippet<Additions, I>(someFunctionThatReturnsAdditions: () => Additions, toDecorate: (props: I) => void) {
function inside(props: I & Additions) {
return toDecorate(props);
}
return inside;
}
function EntrySnippet(props: {entry: Entry}): void {
Shibboleths. Add these up and if you have an opinion on five - agreeing *or* disagreeing - we’d love to hear from you. Do these elicit strong feelings? See the note at the bottom.
- You understand discriminated unions, and how to use the type system to enforce exhaustive checks and other useful patterns.
- You can describe good and bad use cases for single page applications.
- You can describe why nullable types and a type system that enforces it are advantageous over type systems like Java’s.
- You can and have extracted declarative implementations out of imperative code. You know when it’s worth it and when it’s not.
Qualifications / Requirements
- 5+ years of experience developing Web Applications.
- 5+ years of experience in Web technologies such as HTML5, CSS, JavaScript, ECMAScript 6/7.
- 4+ years of experience in JavaScript, including 2+ years of professional experience with frameworks such as React, Angular, and AngularJS.
- Knowledge of JavaScript Patterns and Best Practices.
- Experience with JavaScript Charting Libraries (e.g. D3, ReCharts) and Grids.
- Complete understanding of Responsive Design and comfortable using frameworks such as Twitter Bootstrap.
- Significant experience writing and maintaining client-side tests using frameworks such as Jasmine, Mocha, Karma, Jest, or Selenium WebDriver.
- Solid understanding of version control tools (ideally Git).
- Experience with or understanding of web servers (i.e. Apache, Nginx).

Programming Challenge

Introduction

We're building a simple tool for an international spy agency. The agency conducts planned assassinations and has done so for decades. But it needs a new system to assign assassinations ("hits").

The general user is a hitman. He can be assigned a hit and see it on his list of upcoming work. Typically, it succeeds and is closed out. But occasionally things don't work out and the target lives. In those cases, we assume the target hires

Shibboleths. Add these up and if you have an opinion on five - agreeing *or* disagreeing - we’d love to hear from you. Do these elicit strong feelings? See the note at the bottom.
- You understand discriminated unions, and how to use the type system to enforce exhaustive checks and other useful patterns.
- You can describe good and bad use cases for single page applications.
- You can describe why nullable types and a type system that enforces it are advantageous over type systems like Java’s.
- You can and have extracted declarative implementations out of imperative code. You know when it’s worth it and when it’s not.
import * as React from "react";
import {Link} from "react-router";
import {motion} from "framer-motion";
import {reverse} from "@client/generated";
import * as style from "@client/style";
import {Icon} from "@client/components/Icon";
import {Platform, Icon as IconLiterals} from "@client/constants";
import {Profile} from "@client/models";