Skip to content

Instantly share code, notes, and snippets.

Christopher Thurston cthurston

Block or report user

Report or block cthurston

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cthurston
cthurston / format_phone_number.sql
Last active Aug 6, 2019
A postgres function that attempts to format phone number to RFC 3966
View format_phone_number.sql
CREATE OR REPLACE FUNCTION "public"."format_phone_number"(text)
RETURNS "pg_catalog"."text" AS $BODY$
BEGIN
RETURN
regexp_replace(
regexp_replace(
regexp_replace(
regexp_replace(
regexp_replace(
regexp_replace(
@cthurston
cthurston / ffmpeg_build.sh
Created Aug 2, 2019 — forked from billyshambrook/ffmpeg_build.sh
Build FFMPEG, x264 and FDK-AAC
View ffmpeg_build.sh
sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev \
libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libspeex-dev \
libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev
cd
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
@cthurston
cthurston / react-datasheet-virtualized.jsx
Created Feb 24, 2018
React-Datasheet with React-Virtualized
View react-datasheet-virtualized.jsx
// DataSheet.js
render() {
const { sheetRenderer: SheetRenderer, rowRenderer: RowRenderer, cellRenderer,
dataRenderer, valueRenderer, dataEditor, valueViewer, attributesRenderer,
className, overflow, data, keyFn } = this.props
const { forceEdit } = this.state
return (
<span ref={ r => { this.dgDom = r } } tabIndex='0' className='data-grid-container' onKeyDown={ this.handleKey }>
@cthurston
cthurston / mongodb-facet-combine.js
Created Nov 3, 2017
MongoDb combine $facet results into a single result set.
View mongodb-facet-combine.js
db.getCollection('list').aggregate([
{
$facet: {
"events":[{
$match: {
'type': 'Event'
}
}],
"tasks": [{
$match: {
You can’t perform that action at this time.