Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
| function drips(){ | |
| docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /' | |
| } |
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
| dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 cgroup_enable=memory elevator=deadline rootwait |
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
| (defn deaccent [str] | |
| "Remove accent from string" | |
| ;; http://www.matt-reid.co.uk/blog_post.php?id=69 | |
| (let [normalized (java.text.Normalizer/normalize str java.text.Normalizer$Form/NFD)] | |
| (clojure.string/replace normalized #"\p{InCombiningDiacriticalMarks}+" ""))) |
# View public IP
- curl -s checkip.dyndns.org | sed 's#.Address: (.)</b.*#\1#'
- wget -qO - icanhazip.com
- curl ifconfig.me
- curl ident.me
- dig +short myip.opendns.com @resolver1.opendns.com
- lynx -dump ifconfig.me | grep 'IP Address'
- curl ipecho.net/plain
- curl bot.whatismyipaddress.com
- curl ipinfo.io
Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
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
| ##-- repeatedly find hosts -- | |
| IP_RANGE=172.25.25.0-254 | |
| HOST_LIST=HostList | |
| HOST_LIST_NEW=.tmp_hln | |
| TMP_NEWIP=.tmp_newip | |
| touch $HOST_LIST | |
| nmap -sL -e eth0 -PI -PT -T2 -PS $IP_RANGE | grep -B1 MAC | grep -v "\-\-" | sed -e 's/not scanned//' > $HOST_LIST_NEW | |
| for i in `grep Host $HOST_LIST_NEW| awk '{print $2}'`; do [ `grep $i $HOST_LIST | wc -l` -eq 0 ] && echo $i; done > $TMP_NEWIP | |
| for i in `cat $TMP_NEWIP`; do grep -A1 $i $HOST_LIST_NEW; done >> $HOST_LIST |
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 file is part of the XXX distribution (https://github.com/xxxx or http://xxx.github.io). | |
| * Copyright (c) 2015 Liviu Ionescu. | |
| * | |
| * This program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, version 3. | |
| * | |
| * This program is distributed in the hope that it will be useful, but | |
| * WITHOUT ANY WARRANTY; without even the implied warranty of |
Refactor nrepl makes it possible to hotload a dependency into lein without rebooting the repl. This is awesome but it's not super well documented.
First, make sure you have the plugin installed by adding it to the :plugins key of your
lein profile. This can be done per project in project.clj, but is probably best to include in your
~/.lein/profiles.clj
Here's an example:
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
| qemu-img convert -O vdi gnome.qcow2 gnome.vdi | |
| #if its a raw image then: | |
| VBoxManage convertdd opnstk.raw VBox.vdi --format VDI |