Skip to content

Instantly share code, notes, and snippets.

View florinutz's full-sized avatar
🌴
I'd much rather have Foucalt quoted at computer conferences than Dijkstra

Florin florinutz

🌴
I'd much rather have Foucalt quoted at computer conferences than Dijkstra
  • Berlin
View GitHub Profile
@florinutz
florinutz / review.patch
Created November 29, 2019 12:50
code review for rookie
Index: internal/mywebapp/users/users_test.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- internal/mywebapp/users/users_test.go (date 1575024740000)
+++ internal/mywebapp/users/users_test.go (date 1575030918663)
@@ -1,6 +1,7 @@
package users_test
package main
import "fmt"
func main() {
strs := []string{"a", "b", "c"}
strs2 := []string{"b", "c", "d"}
fmt.Println(intersection(strs, strs2))
}
package main
import "fmt"
func main() {
fmt.Printf("%v\n", find("apple", "ale")) // true
fmt.Printf("%v\n", find("apple", "alp")) // false
}
func find(haystack, needle string) bool {
@florinutz
florinutz / update.go
Created March 29, 2019 14:11
Compressing a boltdb database using gz
package main
import (
"bytes"
"compress/gzip"
"crypto/sha256"
"encoding/gob"
"fmt"
"io/ioutil"
"log"

Keybase proof

I hereby claim:

  • I am florinutz on github.
  • I am fl0 (https://keybase.io/fl0) on keybase.
  • I have a public key ASD41zRDeGapfsblfBD7HAJvPMFQA-tz_5h4ykUwSO1HZgo

To claim this, I am signing this object:

@florinutz
florinutz / gist:56ba16479eb4482cc744f9528d28c96f
Created October 28, 2017 01:01
romaneasca de halloween
Ieşi omul negru
din negru bordei,
luă secure neagră
cu negru temei.
Merse la pădure
tăie negru lemn,
neagra lui secure
are-un negru semn
Făcu un plug negru
cu negru brăzdar,
@florinutz
florinutz / 0_reuse_code.js
Created April 21, 2017 14:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// florin 10/10/14 4:15 PM
$a = new stdClass();
$a->panaMea = "Panama";
$b = $a;
$b->panaMea = "Uzbekistan";
var_export($a);
private function getFrequencySection()
{
$builder = new TreeBuilder();
$node = $builder->root('frequencies');
return $node
->cannotBeEmpty()
->requiresAtLeastOneElement()
->prototype('array')
->beforeNormalization()
->ifString()
frequency:
- [ P2D, 5 ]
- [ T13M, 20 ]