Skip to content

Instantly share code, notes, and snippets.

@paulm17
paulm17 / gist:4b5a0f535f6912beb482dad3ff07a757
Created July 5, 2022 12:45
Controller + Default Values example
<Form
inputComponent={FormInput}
buttonComponent={FormButton}
schema={props.schema as any}
defaultValues={props.initialValues}
onSubmit={async (values) => {
...
}
{({ Field, Errors, Button, control, formState, register, watch }) => (
<>
@paulm17
paulm17 / chrome-snapshot.js
Created June 30, 2017 12:20
NodeJS Snapshot with Chrome Headless
//node index3.js --url="https://www.eff.org" --viewportWidth 480
const CDP = require('chrome-remote-interface');
const argv = require('minimist')(process.argv.slice(2));
const file = require('mz/fs');
const timeout = require('delay');
// CLI Args
const url = argv.url || 'https://www.google.com';
const format = argv.format === 'jpeg' ? 'jpeg' : 'png';
@paulm17
paulm17 / postgres_array.go
Created October 7, 2015 20:43 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
template<class T>
ALWAYS_INLINE
static SmartPtr<T> getResource(ObjectData* obj, const char* varName) {
auto var = obj->o_get(varName, true, s_zmqsocket.get());
if (var.getType() == KindOfNull) {
return nullptr;
}
return cast<T>(var);
}
@paulm17
paulm17 / gist:d80f109ef3853e984655
Created September 21, 2014 21:15
Centos 7 HHVM spec
%define hhvm_dir %{_var}/hhvm
%define hhvm_group hhvm
%define hhvm_user hhvm
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
Name: hhvm
Version: 3.3.0
Release: 1%{?dist}
@paulm17
paulm17 / gist:0fb02a03e5d750aacff3
Created September 20, 2014 03:23
Centos 7 HHVM Spec File
%define hhvm_dir %{_var}/hhvm
%define hhvm_user hhvm
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
Name: hhvm
Version: 3.3
Release: 0.1%{?dist}
Summary: HipHop VM (HHVM) is a virtual machine for executing programs written in PHP