Skip to content

Instantly share code, notes, and snippets.

View wallawe's full-sized avatar
🎯
Focused

wallawe

🎯
Focused
View GitHub Profile
$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 September 7, 2023 03:20
Cloudinary v2 image uploader component in React (using Next.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 01:10
Best practices breadcrumb component for React following Google microdata guidelines
// 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 July 2, 2015 15:14
Google places angular directive that splits out the city, state, country, latitude and longitude
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);