Skip to content

Instantly share code, notes, and snippets.

View alecrem's full-sized avatar
🏠
Working from home

Alejandro Cremades alecrem

🏠
Working from home
View GitHub Profile
@alecrem
alecrem / changedns.sh
Created May 16, 2013 14:13
Swap DNS servers (OSX)
networksetup -getdnsservers Wi-Fi
networksetup -getdnsservers Wi-Fi | while read n
do
if [ "$n" = "There aren't any DNS Servers set on Wi-Fi." ] ; then
echo "none -> google"
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
else
echo "google -> none"
sudo networksetup -setdnsservers Wi-Fi Empty
fi
@alecrem
alecrem / index.php
Last active December 18, 2015 05:48
Quitar los = de la URL cuando envías un formulario GET con checkboxes y quieres la URL un poco más corta. — En vez de index.php?a=&b= conseguimos index.php?a&b — Precaución 1: Se genera una petición más al servidor http y un proceso de PHP. — Precaución 2 por @gallir: si no quieres cargarte todos los signos = sino solo los que vienen tras las va…
<?php
if(strpos($_SERVER['argv'][0], '=')){
$newurl = 'Location: http://PON_ALGO_AQUI?' . str_replace('=', '', $_SERVER['argv'][0]);
header($newurl, true, 301);
die();
}
@alecrem
alecrem / bgimgdl.coffee
Created December 29, 2015 07:56
[Studio Kura]各教室のページの背景をflickrダウンロードして、軽くする
fs = require 'fs'
request = require 'request'
gm = require 'gm'
.subClass {imageMagick: true}
filenames = ['bg-title.jpg', 'bg-otona.jpg', 'bg-kodomo.jpg', 'bg-denshi.jpg', 'bg-timetable.jpg', 'bg-map.jpg']
filenamesg = ['bgg-title.jpg', 'bgg-otona.jpg', 'bgg-kodomo.jpg', 'bgg-denshi.jpg', 'bgg-timetable.jpg', 'bgg-map.jpg']
filename_index = -1
lineReader = require 'readline'
@alecrem
alecrem / .lftprc
Last active January 6, 2016 05:15
set ssl:verify-certificate no
#set net:timeout 2
#set net:max-retries 2
#set net:reconnect-interval-base 5
alias dir ls
alias ll 'ls -l'
alias less more
alias zless zmore
alias bzless bzmore

Keybase proof

I hereby claim:

  • I am alecrem on github.
  • I am alecrem (https://keybase.io/alecrem) on keybase.
  • I have a public key ASB2yAsuQIe8vk6BLcKyegiSyPQiyB5TLTeMmJMzlZhbnAo

To claim this, I am signing this object:

@alecrem
alecrem / treasurehunt.md
Created June 23, 2019 03:47
鞠菜8歳の誕生会の宝探し

たからさがし

はなチーム

  1. てれびの[うし][ろ]
    • うし: 🖼
    • ろ: 20 + 18 = 38 → ろ
  2. [かい]だ[ん]のうえ
    • かい: 🖼貝
  • ん: 88 - 51 = 37 → ん
@alecrem
alecrem / pngdpi.md
Last active July 30, 2019 14:08
Set PNG image to 350 dpi for printing
pngcrush -res 350 card-ja.png card-ja350.png
identify -units PixelsPerInch -format  '%x,%y\n' card-ja350.png
赤鼻のトナカイ (Bajo)
Estrofa
G|---------|---------|---------|---------|---------|---------|---------|---------|
D|---5---5-|---5---5-|---5---5-|-0-5---5-|-0-5---5-|-0-5---5-|-0-5---5-|---5-----|
A|-3---3---|-3---3---|-3---3---|---------|---------|---------|---------|-3---3---|
E|---------|---------|---------|-----3---|-----3---|-----3---|-----3---|---------|
Estribillo
@alecrem
alecrem / akatsuki-chords-es.txt
Created December 7, 2020 08:34
Akatsuki (BABYMETAL): acordes y letra en español
Em C Em
En el fondo de tus ojos brilla
C G D
Una luna que está a punto de llorar
Em C Em
Lágrimas rojas se derraman
Am C D
Tiñendo el cielo de la noche
G B Em D
イントロ / Intro
A C A A#m
A ||--0-0-1-0-3-0-1-0--------|--0-0-1-0-3-0-1-0--------|
E ||-------------------------|-------------------------|
C ||-------------------------|-------------------------|
G ||-------------------------|-------------------------|
A C A#m A
A ||--0-0-1-0-3-0-1-0--------|--1-0-----------1--------|
E ||-------------------------|------3-1-0-1-3----------|