Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ignlg's full-sized avatar
👾
Killing invaders

Ignacio Lago ignlg

👾
Killing invaders
View GitHub Profile
@ignlg
ignlg / gulpfile.coffee
Last active August 26, 2015 08:44 — forked from timthez/closer.js
Close tab on browserSync disconnection, Gulp example
browserSync = require 'browser-sync'
browserSync.use
plugin: ->
hooks:
'client:js': '
/* Close tab when server dies */
(function (bs) {
bs.socket.on("disconnect", function (client) { window.close(); });
})(___browserSync___);'
@ignlg
ignlg / docker-cleanup.sh
Created August 5, 2014 07:39
Docker cleanup script: Removes all the containers (error for running ones) and all the unnamed (<none>) images (error for images attached to a running container)
#!/bin/bash
###
# Docker cleanup script
#
# Cleans all the containers (error for running ones) and all the
# unnamed images (error for images attached to a running container)
#
#
# LICENSE:
#
@ignlg
ignlg / dokku-container-name.sh
Created August 5, 2014 07:58
Dokku apps' container name: Creates all NAME files to assign container names with the dokku-name plugin.
#!/bin/bash
###
# Dokku apps' container name
#
# Creates all NAME files to assign container names with the dokku-name plugin.
#
# Usage: ./dokku-container-name.sh [suffix]
#
# LICENSE:
#
@ignlg
ignlg / Slack Theme
Created September 28, 2015 09:50
Slack theme
#F7F7F7,#CEE3F8,#B3CCE6,#FF3000,#B3CCE6,#336699,#38978D,#FF7500
@ignlg
ignlg / text-to-redis.coffee
Last active January 4, 2016 03:28
Text to Redis.A handy tool to convert a batch of Redis Commands for Mass Insert/Exec. It converts an input text with Redis Commands to an output text in Redis Protocol.
#!/usr/bin/env coffee
###
Text-to-Redis
Author: Ignacio Lago @ignlg
Version: 1.2
A handy tool to convert a batch of Redis commands for mass insert/exec.
@ignlg
ignlg / setup.bash
Last active May 26, 2017 10:40
Setup Mac OS X from scratch using Homebrew & Cask
#!/usr/bin/env bash
###
#
# Setup Mac OS X from scratch using Homebrew & Cask
#
# Version: 1.2.31
# Date: 20151207
# Author: Ignacio Lago @ignlg
# Gist: https://gist.github.com/ignlg/691cb662e92c41289a03
@ignlg
ignlg / example.js
Last active October 21, 2018 15:05
Fixes "TypeError: JSON.stringify cannot serialize cyclic structures" error when exporting to JSON a KeystoneJS model/list including virtuals.
var modelCleanCyclic = require('./modelCleanCyclic');
var Example = new keystone.List('Example', {});
Example.schema.set('toJSON', {
virtuals: true,
transform: modelCleanCyclic.transformer
});
@ignlg
ignlg / bw_export_kp.py
Last active March 31, 2020 18:20 — forked from mpalet/bw_export_kp.py
Export Bitwarden to KeePass 2 XML format, with custom banned fields to clean things up
#!python
"""
Exports a Bitwarden database into a KeePass file (kdbx) including file attachments, custom fields and folder structure.
It can also export an unencrypted XML KeePass file conforming to KeePass 2 XML format.
It requires keepassxc-cli, if not available it can still export KeePass 2 XML
- https://github.com/keepassxreboot/keepassxc
Usage: bw_export_kp.py [-h] [-x] [-d] [-bw-password None] [-kee-password None]
@ignlg
ignlg / keepassxc-url-split.py
Created April 1, 2020 20:04
Creates new KeePass entries as references to original entries when the URL is a list of URLs
from pykeepass import PyKeePass
def clean_url(url):
url_parts = url.split("/")
if url_parts[0] == "http:" or url_parts[0] == "https:":
return url_parts[2]
else:
return url
@ignlg
ignlg / alfred_iterm.applescript
Created April 19, 2020 10:20
Applescript to open a new iTerm window with Alfred and run the written command.
on alfred_script(q)
tell application "iTerm"
activate
create window with default profile
select first window
set onlywindow to true
tell the first window
tell current session to write text q
end tell
end tell