Skip to content

Instantly share code, notes, and snippets.

View send.php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append('{
"message": "Hey {firstName},\\nIt was great meeting you last week at the party. We'd love to have you back at the next one!\\n\\nBest,\\n-Jackie",
"handwriting": <STRING - handwriting id>,
"card": <STRING - stationery id>,
"recipients": [
{
@wallawe
wallawe / image_upload_cloudinary.js
Last active Sep 11, 2019
Cloudinary v2 image uploader component in React (using Next.js)
View image_upload_cloudinary.js
import { Component } from 'react'
import Head from 'next/head'
const CLOUD_NAME = '<name here>'
export default class ImageUploader extends Component {
constructor(props) {
super(props)
this.uploader = null
@wallawe
wallawe / breadcrumb.js
Created May 16, 2019
Best practices breadcrumb component for React following Google microdata guidelines
View breadcrumb.js
// Takes children and wraps them with microdata for SEO purposes
// https://developers.google.com/search/docs/data-types/breadcrumb#guidelines
const BreadCrumbs = ({children}) => (
<ol className="breadcrumbs" itemScope itemType="https://schema.org/BreadcrumbList">
{
React.Children.map(children, (child, i) => (
<li itemProp="itemListElement" itemScope itemType="https://schema.org/ListItem">
{
React.cloneElement(child, {
itemProp: 'item',
@wallawe
wallawe / gist:0a8999bfb50c0ee8bd58
Created Jul 2, 2015
Google places angular directive that splits out the city, state, country, latitude and longitude
View gist:0a8999bfb50c0ee8bd58
angular.module('app').directive('googleplace', [ function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: ['(cities)'],
componentRestrictions: {}
};
scope.gPlace = new google.maps.places.Autocomplete(element[0], options);
@wallawe
wallawe / Part 2
Created Jan 9, 2012
IT, Globalization & the Individual
View Part 2
The Information Technology revolution has paved the way for emerging markets and given developing countries an avenue to compete. In this context, Globalization is moving forward full throttle, and as it turns out, Thomas Friedman was right: the Earth is flat. The many negative short-term effects on jobs for middle-class Americans have been brought to the forefront of the political conversation. Manufacturing was our middle-class's bread and butter, but those jobs are being outsourced and automated. The wealth gap is widening and frustration is palpable. But is this situation as bad as it sounds? How can we view the cup as half-full? It's quite easy with a slight paradigm shift.
The copious positive repercussions of the new "flat world" must take center stage. We begin by empowering those in need who have a desire to better themselves. Anyone with access to technology has the ability to become an entrepreneur, a creator, an artist. It is cheaper than ever to publish your thoughts and ideas, build your comp