Skip to content

Instantly share code, notes, and snippets.

View captbrogers's full-sized avatar

Brian captbrogers

View GitHub Profile
curl -H "X-Meili-API-Key: myApiKey" -X DELETE 'http://127.0.0.1:7700/indexes/locations'
curl -H "X-Meili-API-Key: myApiKey" -X POST 'http://127.0.0.1:7700/indexes' --data '{"name": "Locations", "uid": "locations", "primaryKey": "id"}'
curl -H "X-Meili-API-Key: myApiKey" -X POST 'http://127.0.0.1:7700/indexes/locations/documents' --data @people.json
curl -H "X-Meili-API-Key: myApiKey" -X POST 'http://127.0.0.1:7700/indexes/locations/settings' --data '{"displayedAttributes": ["name","email","location","avatar","level_2_certified","level_1_certified"], "searchableAttributes": ["city","state","country"], "acceptNewFields": false}'
curl -H "X-Meili-API-Key: myApiKey" -X POST 'http://127.0.0.1:7700/indexes/locations/settings/synonyms' --data '{"Alabama": ["AL"],"AL": ["Alabama"],"Alaska": ["AK"],"AK": ["Alaska"],"American Samoa": ["AS"],"AS": ["American Samoa"],"Arizona": ["AZ"],"AZ": ["Arizona"],"Arkansas": ["AR"],"AR": ["Arkansas"],"Brazil": ["BR"],"BR": ["Brazil"],"British Columbia": ["BC"],"BC": ["British C
@captbrogers
captbrogers / people.json
Created May 4, 2020 20:23
Fake data set
[
{
"id": "100",
"name": "Person One",
"email": "person1@email.org",
"location": "Kilauea, Hawaii, United States",
"city": "Kilauea",
"state": "Hawaii",
"country": "United States",
"avatar": "https://pbs.twimg.com/profile_images/1154092629/Square__small_.jpg",
@captbrogers
captbrogers / steam_systeminfo.txt
Created August 30, 2018 04:05
Laptop system info in Steam client
Computer Information:
Manufacturer: ASUS
Model: GL551JW-AH71(WX)
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
CPU Family: 0x6
@captbrogers
captbrogers / box-shadow.html
Created September 11, 2016 21:31 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@captbrogers
captbrogers / snapshot.sh
Last active November 5, 2015 13:39
Rsync for snapshot
#!/bin/bash
# Basic snapshot-style rsync backup script
# Taken from https://wiki.archlinux.org/index.php/Rsync#Snapshot_backup
# Config
## archive, show progress, in human readable sizes
OPT="-aPh"
LINK="--link-dest=/snapshots/username/last/"
SRC="/home/username/"

Keybase proof

I hereby claim:

  • I am captbrogers on github.
  • I am captbrogers (https://keybase.io/captbrogers) on keybase.
  • I have a public key whose fingerprint is E764 EF88 49AD 1D2C 9168 C51A DE1A 5390 A3B8 4CD8

To claim this, I am signing this object:

@captbrogers
captbrogers / ffmpeg install
Last active August 29, 2015 13:59
Ubuntu install FFmpeg from source
#!/bin/bash
# Script Meta
SCRIPT_NAME="ffmpeg-installer"
VERSION="1.0.0"
BUILD_DATE="Wednesday 16 April 2014"
# Colors
txtRESET=$(tput sgr0)
txtBOLD=$(tput bold)
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@captbrogers
captbrogers / grunt-notify-ubuntu
Created November 11, 2013 15:59
Tiny bash to pipe the output of grunt to the system notification
#!/bin/bash
# take the output of grunt and strip the unicode color characters
OUTPUT=`grunt | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
/usr/bin/notify-send -t 1000 Grunt\ Output "${OUTPUT}"
<?
// Quicksilver Score
//
// A port of the Quicksilver string ranking algorithm
// (re-ported from Javascript to PHP by Kenzie Campbell)
// http://route19.com/logbook/view/quicksilver-score-in-php
//
// score("hello world","axl") //=> 0.0
// score("hello world","ow") //=> 0.6