Skip to content

Instantly share code, notes, and snippets.

View xocasdashdash's full-sized avatar
💭
Potatoes and eggs, that's the secret to the world.

Joaquín Fernández Campo xocasdashdash

💭
Potatoes and eggs, that's the secret to the world.
View GitHub Profile
@xocasdashdash
xocasdashdash / main.go
Created September 26, 2022 08:19
Generate a presigned URL for AWS IAM
package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/sts"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
{
// Place your adventofcode workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@xocasdashdash
xocasdashdash / Ansible Dockerfile
Created February 9, 2020 18:26
With Openstack and Python Consul
FROM python:3.7-slim as BUILDER
RUN apt-get update && apt-get install -y --no-install-recommends gcc python-dev && \
pip install netifaces==0.10.9
FROM python:3.7-slim as RUNNER
# Set Workdir
WORKDIR /ansible
# Define volumes
VOLUME [ "/ansible" ]

Keybase proof

I hereby claim:

  • I am xocasdashdash on github.
  • I am xocas (https://keybase.io/xocas) on keybase.
  • I have a public key ASD8OegguXkXOI83aWU0TuHgLWMgkoPABja8TPXWToyn0wo

To claim this, I am signing this object:

04156120f9466712bf7eeae7d486e5ce4673a1ca3d4947c53c2cd7fe478add700c44eeeeba255cb22f44931ecee13d7842adfc09b87b6aac35d591dd3235d5a7dc
@xocasdashdash
xocasdashdash / boxstarter.ps1
Last active October 22, 2017 20:45 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-10-12
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
pipeline {
agent any
parameters {
string(defaultValue: '', description: 'The name of the organization working on this repository.', name: 'orgName')
}
stages{
stage("Create Repo Piplines") {
steps {
@xocasdashdash
xocasdashdash / iterm2-solarized.md
Created April 2, 2017 10:44 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@xocasdashdash
xocasdashdash / infinite-scroll.js
Created August 24, 2014 13:42
Simple infinite scrol with jQuery and a Symfony2 backend
is_processing = false;
last_page = false;
function addMoreElements() {
is_processing = true;
$.ajax({
type: "GET",
//FOS Routing
url: Routing.generate('route_name', {page: page}),
success: function(data) {
if (data.html.length > 0) {
@xocasdashdash
xocasdashdash / DoctrineSessionHandler.php
Last active August 8, 2022 02:09
Storing symfony sessions using doctrine. Based on the PDOSessionHandler that you can find in Symfony\Component\HttpFoundation\Session\Storage\Handler
class DoctrineSessionHandler implements \SessionHandlerInterface {
/**
*
* @var array Parametros de conexión de Doctrine a la base de datos
*/
private $dbalConnection;
/**
*