Skip to content

Instantly share code, notes, and snippets.

View MiyamotoAkira's full-sized avatar

Jorge Gueorguiev Garcia MiyamotoAkira

View GitHub Profile
@MiyamotoAkira
MiyamotoAkira / client.clj
Last active November 3, 2021 17:21
Adding support for having role_arn and source_profile to cognitect aws
(ns aws.client
(:require [cognitect.aws.client.api :as aws]
[cognitect.aws.util :as u]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[cognitect.aws.config :as config]
[cognitect.aws.credentials :as credentials])
(:import (java.io File)))
(defn assumed-role-credentials-provider [parent-profile role-arn]
@MiyamotoAkira
MiyamotoAkira / doors.rb
Created January 1, 2020 19:10
No point on changing the door
prng = Random.new
on_3 = 0
on_2 = 0
on_1 = 0
total = 100000
partial = 0
total_changes = 0
correct_after_change = 0
wrong_after_change = 0
@MiyamotoAkira
MiyamotoAkira / setup-instructions.md
Last active February 28, 2018 13:43
Setup instructions for the Emacs Workshop

Hello everyone,

to get your system ready there are two ways to proceed. One using a Virtualbox setup, the other installing all needed on your personal machines.

VirtualBox version

You need to install VirtualBox. Go to https://www.virtualbox.org/ and Download and install the application (for linux users, you can check if your distro has official packages). After you have done that you will want to download and unzip the file https://s3.eu-west-2.amazonaws.com/emacs-workshop/emacs-vdi.zip (2.6 Gb compressed, 6.2 expanded) and the virtualbox file https://s3.eu-west-2.amazonaws.com/emacs-workshop/Emacs-Basic.vbox (both on the same folder). You can then proceed to add it into Virtualbox (On the Menu Machine->Add).

After that, make sure that you can log into the machine (username and password are emacs). You should see the Emacs icon on the left hand launcher.

Your machine

@MiyamotoAkira
MiyamotoAkira / init.el
Last active June 27, 2018 09:53
Emacs Basics Workshop
(setq custom-file "~/.emacs.d/custom.el")
(require 'package)
(setq package-archives
(quote
(("elpa" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/"))))
Given a client makes a deposit of 1000 on 10-01-2012
And a deposit of 2000 on 13-01-2012
And a withdrawal of 500 on 14-01-2012
When she prints her bank statement
Then she would see
date || credit || debit || balance
14/01/2012 || || 500.00 || 2500.00
13/01/2012 || 2000.00 || || 3000.00
10/01/2012 || 1000.00 || || 1000.00
class Line:
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def find_x(self, y):
return ((self.x2*(y-self.y1)) - (self.x1*y)+(self.x1*self.y2))/(self.y2-self.y1)
@MiyamotoAkira
MiyamotoAkira / appointment-core.clj
Created August 9, 2016 19:19
Simple Liberator application
(ns libtest2.core
(:require [liberator.core :refer [defresource]]
[liberator.dev :refer [wrap-trace]]
[compojure.core :refer [defroutes ANY]]
[clojure.data.json :as json]
[clojure.java.io :as io]))
(defonce appointments (ref []))
(defresource handle-appointments []
@MiyamotoAkira
MiyamotoAkira / TestFactorySubstitute.cs
Last active August 29, 2015 14:28
Use of lambda delegate as factory.
using System;
namespace TestFactorySubstitute
{
public class MyClass
{
public int Execute (Func<string, MyDependency> mydependency, int value)
{
return mydependency(DateTime.Now.ToShortTimeString()).Call(value);