This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store and retrieve an uuid as if it was a cookie | |
function get_uuid() { | |
local client_id_file=${1:-$HOME/.uuid} | |
local client_id="" | |
if [[ -f $client_id_file ]]; then | |
client_id=$(cat $client_id_file) | |
else | |
client_id=$(od -x /dev/urandom | head -1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}') | |
echo "$client_id" > $client_id_file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w = 2; | |
var watcher = new Watcher( | |
'utag.handler.iflag', | |
function(name, o, n, t){ | |
console.log('name: ' + name + ' old: ' + o + ' new: ' + n); | |
if(n === 1){ | |
clearTimeout(t); | |
console.log('exito'); | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url('https://fonts.googleapis.com/css?family=Roboto'); | |
body { | |
background: #e2e1e0; | |
text-align: center; | |
} | |
.card { | |
padding: 16px; | |
font-family: 'Roboto', sans-serif; | |
background: #fff; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " desabilita compatibilidad con vi | |
filetype off " desactiva reconocimiento de archivo por el momentoju | |
" añade Vundle al runtime para poder ejecutarlo | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" repositorio de vundle para comprobar las propias actualizaciones | |
Plugin 'VundleVim/Vundle.vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$(whoami) | |
EXPOSE=3000 | |
CONTAINER=$(basename $(pwd)) | |
[ -d node_modules ] && rm -rf node_modules | |
if grep -q $CONTAINER <<< $(docker ps -a); then | |
echo detiene el contenedor | |
docker stop $CONTAINER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$(whoami) | |
EXPOSE=3000 | |
CONTAINER=$(basename $(pwd)) | |
[ -d node_modules ] && rm -rf node_modules | |
if grep -q $CONTAINER <<< $(docker ps -a); then | |
echo detiene el contenedor | |
docker stop $CONTAINER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;________________________________________________________________________ | |
; Selects the bank the variable is in before operating with it. | |
; | |
; The 'banksel' directive is a macro that MPASM assembles changing the | |
; bits RP from the STATUS register. | |
; | |
; As there are 4 banks, if this is not performed, data will be written | |
; in te wrong bank | |
;________________________________________________________________________ | |
#include "p16F877.inc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;=====================================================; | |
; This piece of code runs certain times depending on ; | |
; how many nested loops you create. Each loop can ; | |
; count up to 255. ; | |
; We declare a variable for each loop and preload ; | |
; them with the default value (maxium FFh or 255d ; | |
; For demonstration purposes we're using just 3 ; | |
; nested loops executing a total of 845.325 times ; | |
;=====================================================; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Based on http://unix.stackexchange.com/a/12483 | |
# To use it you have to give it execution privilleges | |
# with the command: | |
# chmod u+x split.py | |
# Then you can use it like this: | |
# ./split.py <slides.pdf >split.pdf | |
import copy, sys | |
from pyPdf import PdfFileWriter, PdfFileReader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Call this script as root like: | |
# ./addmediauser.sh myusername mypassword | |
# Password will be shown in plain text (obviously) | |
# so watch out for shoulder surfers! | |
USERNAME=$1 | |
PASSWORD=$2 | |
useradd --create-home --groups samba timemachine --shell /bin/false $USERNAME |