Skip to content

Instantly share code, notes, and snippets.

View report.sql
with work_history as (
select
distinct on (profile_id)
profile_id,
created_at
from profiles_workhistory
where finalized = true
order by profile_id, created_at asc, id
), verification as (
select
View query.sql
select
id,
casenumber,
client__r.firstname,
client__r.lastname
from case
where
status != 'Closed'
and client__c != null
and client__r.recordtypeid in ('01241000000yZEzAAM', '01241000001YbAWAA0')
View gist:18a9bcb366c36b4915470eb1d5d234dc
var Comment = {
oninit: function (vnode) {
this.comment = vnode.attrs;
},
view: function () {
var item, extra, that;
that = this;
item = this.comment;
if (item.children.length == 0) {
return m("li", {key: item.id}, [
View script.js
"use strict";
var log = function(msg) {
console.log(msg);
};
var SelectWidget = {},
App = {},
path = [],
data = {
phone: {
View boundary_scanner.md

My mappings:

{
  "abstract": {
    "type": "text",
    "term_vector": "with_positions_offsets"
  },
  "app_country": {
    "type": "text",
View result.js
function parseLabel(label, r) {
const res = r || [];
res.push(label.label_name.replace(/[,\s]+$/g, '').trim())
if (label.label_child) {
parseLabel(label.label_child, res)
}
return res.join(', ');
}
classifications = parseLabel(result._source.classifications[0])
View index.php
<?php
#exit;
#$ua=$_SERVER['HTTP_USER_AGENT'];
#if ($ua == 'GuzzleHttp/6.2.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.17') {
#header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
#header("Status: 404 Not Found");
#$_SERVER['REDIRECT_STATUS'] = 404;
#exit;
View index.js
var https = require('https'),
http = require('http'),
url = require('url'),
restify = require('restify'),
FeedParser = require('feedparser'),
log = console.log.bind(console);
var get = (str, callback) => {
var handler = res => callback(res),
endpoint = url.parse(str),
View bobosales-backup.sh
export PGPASSWORD=redacted
export AWS_ACCESS_KEY_ID=redacted
export AWS_DEFAULT_REGION=us-west-2
export AWS_SECRET_ACCESS_KEY=redacted
pg_dump -h shops-ksl-com.cxpx7kkpqtcv.us-west-2.rds.amazonaws.com -U redacted redacted | gzip | mpipe ~~/stor/bobosales/`date +%Y-%m-%d`-backup.sql.gz
easy_install-2.7 awscli
aws s3 sync s3://images.bobosales.com/ images/
tar -cf images.tar images
gzip images.tar
mput -f images.tar.gz ~~/stor/bobosales/images.tar.gz
View tmp.js
var bf5 = {};
bf5.util = {
getQueryParameter: function (name) {
var url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";