Skip to content

Instantly share code, notes, and snippets.

View phss's full-sized avatar

Paulo Schneider phss

  • Lisbon, Portugal
View GitHub Profile
@phss
phss / .p10k.zsh
Last active August 10, 2022 11:18
p10k configuration
# Generated by Powerlevel10k configuration wizard on 2022-04-12 at 17:30 WEST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 52170.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# 24h time, angled separators, sharp heads, round tails, 2 lines, solid, no frame,
# sparse, many icons, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
precision mediump float;
uniform sampler2D u_image; // s_p
varying vec2 v_texCoord; // texCoord
// Horizontal cubic filter.
// Some known filters use these values:

Keybase proof

I hereby claim:

  • I am phss on github.
  • I am phss (https://keybase.io/phss) on keybase.
  • I have a public key ASCb7PU-YZHiqyxI8QmucxIzpKEI8pOWzU3-ZxQ3nTSz0go

To claim this, I am signing this object:

@phss
phss / es_dump_and_import.sh
Created November 21, 2013 10:10
ElasticSearch dump and import
#!/bin/bash
for day in $(seq -f "%02g" 1 20)
do
index="logstash-2013.11.$day"
echo "Processing index $index"
#esdump --url http://localhost:9200 --indexes $index --gzip --file $index.gz
#esimport --url http://elasticsearch:9200 --file $index.gz --index $index
done
@phss
phss / backdrop-api-urls.txt
Last active December 27, 2015 03:59
REST API diff script
/performance/deposit-foreign-marriage/api/journey?start_at=2013-10-28T00%3A00%3A00%2B00%3A00&end_at=2013-11-04T00%3A00%3A00%2B00%3A00
/performance/deposit-foreign-marriage/api/realtime?sort_by=_timestamp%3Adescending&limit=2
/performance/deposit-foreign-marriage/api/journey?end_at=2013-11-04T00%3A00%3A00%2B00%3A00&start_at=2013-09-01T23%3A00%3A00%2B00%3A00
/performance/deposit-foreign-marriage/api/monitoring?period=day&collect=downtime%3Asum&collect=uptime%3Asum&collect=unmonitored%3Asum&collect=avgresponse%3Amean&end_at=2013-11-04T00%3A00%3A00%2B00%3A00&start_at=2013-10-05T00%3A00%3A00%2B00%3A00
/performance/deposit-foreign-marriage/api/realtime?sort_by=_timestamp%3Adescending&limit=2
/performance/lasting-power-of-attorney/api/volumes
/performance/lasting-power-of-attorney/api/journey?start_at=2013-10-28T00%3A00%3A00%2B00%3A00&end_at=2013-11-04T00%3A00%3A00%2B00%3A00
/performance/lasting-power-of-attorney/api/journey?start_at=2013-10-28T00%3A00%3A00%2B00%3A00&end_at=2013-11-04T00%3A00%3A00%2B00%3A00&filter_b

Graphing and Charts

Name Link Comment
Highcharts http://www.highcharts.com/ Free for non-profit. Good set of graphs and charts.
D3 http://d3js.org/ Powerful and flexible. Good option to learn, but some learning curve.
NVD3 http://nvd3.org/ Leverage D3's tech. Provide easier to assemble graphs.
Infogram http://infogr.am/ Easy to enter data. Loads of graph and charts. Like a web-Excel for charting.
Excel-like -- Not sexy, but very practical.
require "dm-core"
require "dm-validations"
require "dm-timestamps"
require "digest"
class User
include DataMapper::Resource
property :id, Serial
property :username, String, :required => true, :unique => true
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
post '/:name/:filename' do
userdir = File.join("files", params[:name])