Skip to content

Instantly share code, notes, and snippets.

View harrygr's full-sized avatar

Harry harrygr

View GitHub Profile
@harrygr
harrygr / absintheMultipartFetchExchange.ts
Created April 14, 2020 16:20
URQL Multipart Fetch Exchange for Absinthe
import { Kind, DocumentNode, OperationDefinitionNode, print } from 'graphql';
import { filter, make, merge, mergeMap, pipe, share, takeUntil } from 'wonka';
import {
Exchange,
Operation,
OperationResult,
makeResult,
makeErrorResult,
} from 'urql';
@harrygr
harrygr / brew.sh
Last active April 26, 2018 14:06
Useful brew packages
#!/bin/bash
brew install zsh zsh-completions
# oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
# Apps
brew cask install 1password
brew cask install google-chrome
@harrygr
harrygr / new_computer.md
Last active April 26, 2017 07:58
New Computer?

You need git on a mac

xcode-select --install

A tasty brew 🍺

<?php
$stack = HandlerStack::create();
$middleware = new Oauth1([
'consumer_key' => config('services.xero.key'),
'consumer_secret' => config('services.xero.secret'),
]);
$stack->push($middleware);
$client = new Client([
@harrygr
harrygr / Envoy.blade.php
Last active January 19, 2023 23:06
Envoy deploy script for Laravel
{{--
INSTRUCTIONS
1. On your local/build/deployment system:
- Ensure Laravel Envoy is installed on your deployment box (local computer, build server etc - not your production server).
(see https://laravel.com/docs/5.2/envoy)
- Set up a certificate or ssh config such that you can ssh to your production server without prompt.
- Update the @servers array below with your production ssh details or ssh config.
- Update the $php variable to represent the php app server for your server.
@harrygr
harrygr / composer.json
Created November 26, 2015 15:57
Paul Graham Essay Generator
{
"require": {
"fabpot/goutte": "^3.1",
"ucsdmath/pdf": "^1.4"
},
"autoload": {
"psr-4": {
"": ""
}
}
@harrygr
harrygr / horizontal-image-scroller.js
Last active April 25, 2017 12:58
Horizontal Image Scroller - JQuery plugin
/**
* A simple plugin to horizontally loop an image from right to left.
* Example usage:
*
* HTML: <div class="myContainer"><img src="//example.com/image.jpg" /></div>
* JS: $('.myContainer').scrollify();
*
* @author: harryg <harry@harryg.me>
*/
@harrygr
harrygr / Laravel: query log
Created November 18, 2014 15:08
Laravel: query log
print_r(DB::getQueryLog());
@harrygr
harrygr / Laravel Blade: link button
Created November 17, 2014 15:44
Laravel Blade: link button
@harrygr
harrygr / HTML: table
Created November 17, 2014 13:52
HTML: table
<table class="table">
<thead>
<tr>
<th>...</th>
</tr>
</thead>
<tbody>
...
</tbody>
</table>