Skip to content

Instantly share code, notes, and snippets.

View endorama's full-sized avatar
:shipit:

Edoardo Tenani endorama

:shipit:
View GitHub Profile
@endorama
endorama / struct.go
Last active March 15, 2022 14:01
Golang time testing pattern
package str
func UnixTimestamp() int64 {
return time.Now().Unix()
}
type FragmentCreator struct {
slug string
// timeNowUnix is only used in testing to override getting the current timestamp
@endorama
endorama / down
Last active October 28, 2020 18:39
[Salt: minion operations] #salt #status
salt-run manage.down
@endorama
endorama / # aws-google-auth - 2019-09-23_19-30-15.txt
Created September 23, 2019 17:37
aws-google-auth on elementary OS 5.0 Juno - Homebrew build logs
Homebrew build logs for aws-google-auth on elementary OS 5.0 Juno
Build date: 2019-09-23 19:30:15
@endorama
endorama / argv.cr
Last active April 28, 2017 10:49
Crystal lang TCS presentation
# Demo of command line arguments
# ARGV[0]: First command line argument
# (not the executable name)
# ARGV is an array of strings
puts "Number of command line arguments: #{ARGV.size}"
ARGV.each_with_index {|arg, i| puts "Argument #{i}: #{arg}"}
# The executable name is available as PROGRAM_NAME
puts "Executable name: #{PROGRAM_NAME}"
@endorama
endorama / keybase.md
Created February 23, 2017 19:07
keybase.md

Keybase proof

I hereby claim:

  • I am endorama on github.
  • I am endorama (https://keybase.io/endorama) on keybase.
  • I have a public key ASAKweB5myH-17sUIf-UoqlzUNopDTCLTcUzK4hV3tW7kgo

To claim this, I am signing this object:

@endorama
endorama / bash-header.sh
Last active March 17, 2017 11:11
Quick bash header
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# SCRIPT="$(readlink --canonicalize-existing "$0")"
# SCRIPTPATH="$(dirname "$SCRIPT")"
# SCRIPTNAME="$(basename "$SCRIPT")"
@endorama
endorama / FilterLog
Last active August 29, 2015 14:06
FilterLog example
{
[...]
addWithData: function(msg, data) {
var copy = angular.copy(data);
this.maskReserved(copy);
$log.debug(msg + ' :: ' + copy, type);
},
maskReserved: function(obj) {
@endorama
endorama / class.js
Last active August 29, 2015 14:02
Namespace JavaScript class prototype pattern
// define application namespace ( this is window )
this.Namespace = this.Namespace || {};
(function() {
"use strict";
function Foobar() {};
var p = Foobar.prototype; // = new Object(); // to extend Foobar
@endorama
endorama / factory.js
Last active August 29, 2015 14:00
AngularJS class design pattern
(function() {
"use strict";
var module = angular.module('foo');
module.factory('fooFactory', [
function() {
// Define the constructor function.
function FooClass() {}