Skip to content

Instantly share code, notes, and snippets.

View manzanit0's full-sized avatar

Javier García manzanit0

View GitHub Profile
@manzanit0
manzanit0 / tortilla.md
Created July 7, 2020 10:27
Tortilla recipe

Ingredients​

  • 0.5L Extra Virgin Olive Oil, Spanish not Italian :-)

  • 4 Big Potatoes (1kg aprox.)

  • 1 big onion

  • 6 large eggs

@manzanit0
manzanit0 / extensions.sh
Last active November 24, 2021 09:02
My personal VS Code configuration
# theming
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
# terminal
code --install-extension formulahendry.terminal
code --install-extension msamueltscott.maximizeterminal
# general stuff
code --install-extension vscodevim.vim
@manzanit0
manzanit0 / ubuntu-setup.md
Last active December 4, 2019 00:04
My personal ubuntu setup guide

Setting up Ubuntu from scratch

Keyboard set up - English (intl. with AltGr dead keys)

Some out of the box basics:

sudo apt install git
@manzanit0
manzanit0 / main.kt
Last active September 30, 2019 09:46 — forked from orangy/event.kt
An use case for synthetic events in Kotlin
/**
* This is a generic event class. It simply allows subscription and invocation.
*/
class Event<T> {
private val handlers = arrayListOf<(Event<T>.(T) -> Unit)>()
operator fun plusAssign(handler: Event<T>.(T) -> Unit) { handlers.add(handler) }
operator fun invoke(value: T) { for (handler in handlers) handler(value) }
}
/**
@manzanit0
manzanit0 / pooled_crawler.ex
Last active July 25, 2022 08:58
Web crawler which uses Floki and HTTPoison – does 5 request at a time
# Dependencies:
# {:httpoison, "~> 1.5"},
# {:floki, "~> 0.21.0"}
# {:benchee, "~> 1.0"} (Only for benchmarking – not in the script)
defmodule CrawlQueue do
use Agent
def start_link(urls) do
@manzanit0
manzanit0 / remote-backup.py
Last active July 11, 2019 09:59
Create remote DB backup via SSH
#!/usr/bin/env python3
from paramiko import SSHClient, RSAKey, AutoAddPolicy
import sys, argparse, time
def ssh_connect(host, user, key):
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(AutoAddPolicy())
@manzanit0
manzanit0 / EchoServer.java
Created May 30, 2019 16:29
Echo Server in Java
package com.manzanit0;
import java.io.*;
import java.net.ServerSocket;
public class EchoServer {
public static void main(String[] args) {
int portNumber = 4098;
try (
@manzanit0
manzanit0 / keybindings.json
Created May 20, 2019 15:08 — forked from whazzmaster/keybindings.json
Test tasks for Visual Studio Code and Elixir
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t cmd+t",
"command": "workbench.action.tasks.runTask",
"args": "Run All Tests"
},
{
"key": "f5",
"command": "workbench.action.tasks.runTask",
@manzanit0
manzanit0 / index.md
Last active May 14, 2019 12:46
Docker in AWS EB

Taggin an image: docker tag image username/repository:tag

Publishing images in a remote repository: docker push username/repository:tag

Running an image in a remote repository: docker run -p 4000:80 username/repository:tag

Cloud Container Registry services

Keybase proof

I hereby claim:

  • I am manzanit0 on github.
  • I am manzanit0 (https://keybase.io/manzanit0) on keybase.
  • I have a public key ASDnQn9ajRDtZa_TXOM8fz_siDnddZxqmWu_Jsd-pRyyggo

To claim this, I am signing this object: