Skip to content

Instantly share code, notes, and snippets.

View Hugoberry's full-sized avatar

Igor Cotruta Hugoberry

View GitHub Profile
@Hugoberry
Hugoberry / Number.DEC2BIN.m
Last active March 15, 2017 17:30 — forked from IvanBond/Number.ToBinaryString.m
DEC2BIN or HEX2BIN in Power Query M
(num as number)=>
List.Last(
List.Generate(
() =>[reminder = num,
binString= Number.ToText(Number.BitwiseAnd(reminder,1))],
each [reminder]> 0,
each [reminder = Number.BitwiseShiftRight([reminder],1),
binString= Number.ToText(Number.BitwiseAnd(reminder,1))&[binString]],
each [binString]
)
@Hugoberry
Hugoberry / gist:133ccf51544d96a8cb9b39f6d5a60e3d
Created June 7, 2017 09:43 — forked from simcop2387/gist:5493206
List of all named curves on wolfram alpha!
{"Archimedean spiral",
"Archimedes’ spiral",
"astroid",
"astroid pedal curve",
"bifoliate",
"bifolium",
"butterfly catastrophe curve",
"second butterfly curve",
"cardioid",
"cardioid pedal curve",
@Hugoberry
Hugoberry / TransactSqlScriptDomTest.cs
Created July 7, 2017 08:46 — forked from philippwiddra/TransactSqlScriptDomTest.cs
Some examples with Microsoft.SqlServer.TransactSql.ScriptDom and TSql generation and parsing
using Microsoft.SqlServer.TransactSql.ScriptDom;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TransactSqlScriptDomTest
{
@Hugoberry
Hugoberry / push_to_github.rb
Created January 25, 2018 14:17 — forked from harlantwood/push_to_github.rb
Commit and push via Github REST API, from ruby RestClient
# Committing changes to a repo via the Github API is not entirely trivial.
# The five-step process is outlined here:
# http://developer.github.com/v3/git/
#
# Matt Swanson wrote a blog post translating the above steps into actual API calls:
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
#
# I was not able to find sample code for actually doing this in Ruby,
# either via the HTTP API or any of the gems that wrap the API.
# So in the hopes it will help others, here is a simple function to
let func =
(SelectionList as list, ListOfPositions as list, optional StartWithOne as number) =>
let
selectionList = List.Buffer(SelectionList),
listOfPositions = List.Buffer(ListOfPositions),
StartPosition = if StartWithOne = 1 then -1 else 0,
Result = List.Transform(ListOfPositions, each SelectionList{_ + StartPosition}?)
in
@Hugoberry
Hugoberry / RowExpression.From.pq
Created March 7, 2018 06:00 — forked from CurtHagenlocher/RowExpression.From.pq
RowExpression.From as JSON
let
Value.FixType = (value, optional depth) =>
let
nextDepth = if depth = null then 3 else depth - 1,
result = if depth = 0 then null
else if value is type then TextType(value)
else if value is table then Table.TransformColumns(value, {}, @Value.FixType)
else if value is list then List.Transform(value, each @Value.FixType(_, nextDepth))
else if value is record then
Record.FromList(List.Transform(Record.ToList(value), each @Value.FixType(_, nextDepth)), Record.FieldNames(value))
Sparkline Line =
// Static line color
VAR LineColor = "#01B8AA"
// "Date" field used in this example along the X axis
VAR XMinDate = MIN('Table'[Date])
VAR XMaxDate = MAX('Table'[Date])
// Obtain overall min and overall max measure values when evaluated for each date
@Hugoberry
Hugoberry / README.md
Last active September 13, 2018 08:44 — forked from 1wheel/README.md
regl-ladder

Rough draft of this chart.

We started out with a SVG animation, tried out Elijah's canvas sankey particles and ended up rewriting in regl to get more dots on the screen.

The final version gets better performance by passing in array of attibutes to the vertex shader - I'm not sure why that is.

Update: Ricky Reusser points out that I was creating a new array of points every frame with:

attributes: {x: () => data.map(d => d.x)}

@Hugoberry
Hugoberry / .block
Created September 13, 2018 08:45 — forked from micahstubbs/.block
Sankey Particles | d3v4 & es2015+
border: no
license: Apache-2.0
@Hugoberry
Hugoberry / gist:9561e5a41473ce19ca282a0e5e6cc1c6
Created October 16, 2018 08:57 — forked from sean3z/gist:b6426ed9dae521c4b56948ce2c6062b1
AB Benchmark Node.js (via Restify) - 10,000 requests (10 concurrent)
D:\www\apache-2.4.25\bin>ab.exe -n 10000 -c 10 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software:
Server Hostname: localhost
Server Port: 8080