Skip to content

Instantly share code, notes, and snippets.

View WesSouza's full-sized avatar
🚥
Working on code.

Wes Souza WesSouza

🚥
Working on code.
View GitHub Profile
<?php
$notif_post_data = array
(
"user_credentials" => "--CREDENTIALS-HERE--",
"notification[message]" => "Notification Dialog Message",
"notification[long_message]" => "<b>HTML Description</b>",
"notification[title]" => "Message Title",
"notification[long_message_preview]" => "Message Preview",
"notification[message_level]" => "0",
function checkUrl ( url ) {
function checkUrlInternal ( resolve, reject, url, count ) {
count = count || 0;
posts.find( { url: url } )
.then( function ( posts ) {
if ( posts.length ) {
count ++;
if ( count > 10 ) {
reject( new Error( 'url:tooManyReplaces' ) );
}
@WesSouza
WesSouza / minreq.js
Created September 29, 2014 18:54
Require/define, min.
;(function(where){
var defined={},required={};
function define(thing,something){
defined[thing]=something
}
function require(thing){
required[thing]=required[thing]||defined[thing]()
return required[thing]
}
where.define=define
@WesSouza
WesSouza / block.js
Created October 22, 2014 22:13
I like LEGO and JavaScript.
( function ( self ) {
var library = {};
var GlobalDomain = {
instances: {},
getInstance: function ( name ) {
var instance = this.instances[ name ] || ( typeof library[ name ] == 'function' ? library[ name ]() : library[ name ] );
this.instances[ name ] = instance;
return instance;
}
@WesSouza
WesSouza / schema.graphql
Created September 28, 2017 15:34
Choosing GraphQL for your API - Schema
# The Meetup object, and all of its properties
type Meetup {
id: ID!
name: String!
description: String!
price: Int!
priceFormatted: String!
isAvailable: Boolean!
}
@WesSouza
WesSouza / HeaderWishlist.jsx
Created September 28, 2017 15:35
Choosing GraphQL for your API - React Component
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
// GraphQL libraries
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
// React magic here
class HeaderWishlist extends Component { ... }
@WesSouza
WesSouza / zeit-now-g-suite-setup.md
Last active March 27, 2019 18:23 — forked from jaydenseric/zeit-now-g-suite-setup.md
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA with your details:

export NOW_DOMAIN=yourdomain.com
export GOOGLE_VERIFICATION=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
now dns add "$NOW_DOMAIN" @ TXT "google-site-verification=$GOOGLE_VERIFICATION"
now dns add "$NOW_DOMAIN" @ MX ASPMX.L.GOOGLE.COM 1
now dns add "$NOW_DOMAIN" @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add "$NOW_DOMAIN" @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add "$NOW_DOMAIN" @ MX ALT3.ASPMX.L.GOOGLE.COM 10
@WesSouza
WesSouza / TABLES.md
Created December 18, 2019 22:01
Sad Markdown Tables
Is there Any way to do this nicely?
Left cell is large Right cell has more content than a nice 80 column
layout would fit, I'd love to break lines.

The only way is to put the entire text into one line, as each line becomes a <tr>.

Also, VS Code automatically formats it and i cry.

@WesSouza
WesSouza / Component.tsx
Created August 19, 2022 11:35
prop getter function returned by hooks thingy
export Google({ customAriaLabelForSomeReason }) {
const { getInputProps, options } = useGoogle();
const inputProps = getInputProps({ 'aria-label': customAriaLabelForSomeReason })
return (
<div>
<input {...inputProps} />
{options.length ? <div>{options.map(...)}</div> : ''}
</div>
@WesSouza
WesSouza / FruitCorners.txt
Created March 30, 2023 02:48 — forked from macserv/FruitCorners.txt
A brief history of the Fruit Corners brand (1980–1987) from General Mills
Thank you for contacting General Mills with your inquiry. We have enclosed all information we have available regarding the Fruit Corners line of products.
We hope you find this information helpful. Please let us know if we can help you again
Sincerely,
Katie Gafler
Consumer Services