Skip to content

Instantly share code, notes, and snippets.

View jion's full-sized avatar

Manuel Schnidrig jion

View GitHub Profile
Verifying that +mschnidrig is my blockchain ID. https://onename.com/mschnidrig
@jion
jion / PersonaController.php
Last active November 3, 2015 21:06
Controller basico + Servicio Symfony (php)
<?php
namespace Bundle\PersonaBundle\Controller;
class PersonaController extends Controller
{
public function nuevaAction (Request $request)
{
// Validar permisos de usuario
if ($this->get('security.context')->isGranted(Permiso::AUTH_CREAR_PERSONA) === false) {
@jion
jion / rot13Reader.go
Created February 9, 2016 23:38
My solution to "rot13Reader" excercise of "A Tour of Go"
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@jion
jion / .vimrc
Created December 16, 2016 15:20
set nocompatible " be iMproved
filetype on
"""""""""""""""""""
" Begin Plug Block (https://github.com/junegunn/vim-plug)
"""""""""""""""""""
function! BuildYCM(info)
" info is a dictionary with 3 fields
" - name: name of the plugin
" - status: 'installed', 'updated', or 'unchanged'
@jion
jion / MyClass.js
Last active January 11, 2017 20:40
Base template for create OOP classes in Javascript ES5
{ // MyClass
var MyClass = function () {
var self = this;
setupPublicProperties({
publicVariable1: 'foo',
publicVariable2: 'bar',
});
setupPrivateProperties({
@jion
jion / BEM Explanaition.html
Created February 23, 2017 18:18
BEM Explanaition
<div class="modal"> <!-- "Bloque. es el nombre del componente. se usa esta sintaxis: tu-vieja -->
<div class="modal__title"> <!-- Elemento. es una parte de las que compone al blouqe. usas bloque__elemento" -->
Esto es el titulo del modal
</div>
<div class="modal__footer"> <!-- Otro element. es el fotter que tiene los botones -->
<div class="button">Cancelar</div> <!-- dentro podes usar "minicomponentes" genéricos. aca quedaría medio choto usar "modal__button" porque todos los buttons son iguales en el sitio -->
<div class="button--primary">ACEPTAR</div> <!-- modificator. Es una variación del bloque/elemento origuinal. En este caso es el mismo estilo del botón, solo que, pongámosle, es de color azul o rojo mientras que el botón común es blanco" -->
</div>
</div>
@jion
jion / .tmux.conf
Created May 25, 2017 00:41 — forked from v-yarotsky/.tmux.conf
Mac OS X tmux config
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@jion
jion / keybase.md
Created September 20, 2017 16:01
Keybase proof

Keybase proof

I hereby claim:

  • I am jion on github.
  • I am jion (https://keybase.io/jion) on keybase.
  • I have a public key ASDUc4CSKKREq-BgEzVIvFuWMj2zWla5fu7rQyWr485_OQo

To claim this, I am signing this object:

@jion
jion / is_braces_balanced.py
Last active February 18, 2018 17:59
Exercise that I had to do in a live sharing-code interview
def is_balanced(input_string):
pending_braces = list()
open_braces, closing_braces = '[{(', ']})'
for c in input_string:
if c in open_braces:
index = open_braces.index(c)
pending_braces.append(closing_braces[index])
continue
@jion
jion / LoggerRedirection.py
Created May 25, 2018 16:22
Allows to redirect all the messages on a specific logger to another specified logger
import logging
class RedirectLoggingHandler(logging.Handler):
def __init__(self, dest_logger):
logging.Handler.__init__(self)
self.dest_logger = dest_logger
def emit(self, record):
try:
record.name = self.dest_logger.name