Skip to content

Instantly share code, notes, and snippets.

View fragoulis's full-sized avatar

Yannis Fragoulis fragoulis

View GitHub Profile
@fragoulis
fragoulis / interview.md
Last active April 2, 2024 07:31
Interview

The interview

  • introductions - 5 minutes
  • discussion - 45 minutes
  • q&a - 10 mintues

The goal

  • to build a team of go developers that will work closely with the biostrand development team to develop their product
@fragoulis
fragoulis / go_validator_cheatsheet_creator.go
Created July 3, 2023 14:22
Go validator cheatsheet creator
package main
import (
"fmt"
"github.com/go-playground/validator/v10"
)
func main() {
validator := validator.New()
@fragoulis
fragoulis / start_stop.sh
Last active January 26, 2021 07:56
Getting a memory profile on a running ruby process
bundle exec rbtrace -p $1 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}'
bundle exec rbtrace -p $1 -e 'Thread.new{require "memory_profiler"; MemoryProfiler.start}'
bundle exec rbtrace -p $1 -e 'Thread.new{require "memory_profiler"; MemoryProfiler.stop.pretty_print(to_file: "/tmp/memory_profiler.log", detailed_report: true, scale_bytes: true)}'
@fragoulis
fragoulis / clean_up_docker.sh
Created December 28, 2019 09:18
Clean up docker
# Remove stopped containers
docker rm $(docker ps -a -q)
# Remove untagged images
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')
@fragoulis
fragoulis / commands.md
Last active March 6, 2019 08:59
Linux
@fragoulis
fragoulis / index.html
Created April 12, 2017 14:24
HTML Bootstrap
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@fragoulis
fragoulis / nanotime.rb
Created November 21, 2016 11:14
Time extensions for
class Nanotime
def in_seconds(now = ::Time.current)
now.strftime("%s000000000")
end
def in_milliseconds(now = ::Time.current)
now.strftime("%s%3N000000")
end
def in_microseconds(now = ::Time.current)
@fragoulis
fragoulis / sublime-bindings.json
Created April 27, 2015 09:10
Sublime Text Bindings
[
{ "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": false } }
]
@fragoulis
fragoulis / sublime-settings.json
Created April 27, 2015 09:09
Sublime Text Settings
{
"font_size": 11,
"open_files_in_new_window": true,
"remember_full_screen": true,
"rulers":
[
80
],
"tab_size": 4,
"translate_tabs_to_spaces": false
@fragoulis
fragoulis / PostgreSql.php
Created February 13, 2015 10:04
PostgreSQL helpers for manipulating tables and sequences
<?php
/**
* Helper class.
*
* This class provides some static methods that are helpful with
* postgres like manually manipulating sequences and dropping
* tables cascaded.
*
* It also provides the ability to create a batch insert (COPY)