Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

View inkel's full-sized avatar
:shipit:
The floating head with a beard

Leandro López inkel

:shipit:
The floating head with a beard
View GitHub Profile
@inkel
inkel / pipe.go
Created February 20, 2026 12:38
Simple Go function to pipe an `exec.Cmd` to `jq`
package pipe
func shell2jq(ctx context.Context, jqScript string, command string, args ...string) (string, error) {
// Here be dragons
var (
cmd = exec.CommandContext(ctx, command, args...)
jq = exec.CommandContext(ctx, "jq", "-r", jqScript)
r, w = io.Pipe()
g = new(errgroup.Group)
out bytes.Buffer
package main
import (
"fmt"
"time"
)
func main() {
var (
ch = make(chan int)
package main
import (
"strconv"
"testing"
)
func BenchmarkSetSpeed(b *testing.B) {
set := make(map[string]int)
for i := 0; i < 10; i++ {
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace AsyncTest
{
class Program
{
static void Main(string[] args)
{

Keybase proof

I hereby claim:

  • I am inkel on github.
  • I am inkel (https://keybase.io/inkel) on keybase.
  • I have a public key ASAseuKQokVV8apQZnqXgYpxDy-Ra8zQew1idmeGghr29Qo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am inkel on github.
  • I am inkel (https://keybase.io/inkel) on keybase.
  • I have a public key ASBYs1aMV3jeduW9sIiY6O0FLZfG5vN4e5B8fCbOVhSATwo

To claim this, I am signing this object:

#! /usr/bin/env ruby
require "benchmark/ips"
class Foo
attr_accessor :params
def perform(params)
self.params = params
246
9
3
54
237
126
6
3
3
21
@inkel
inkel / podcast.diff
Created April 6, 2016 20:29
Arreglame los h1!
82c82
<
---
>
90c90
< <h1>Cero a la izquierda</h1>
---
> <h1><a href="/podcast/cero_a_la_izquierda/">Cero a la izquierda</a></h1>
95c95
<
#! /usr/bin/env ruby
GC.disable
require "objspace"
FMT = <<STATS.freeze
before %10d
after %10d
----------