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
| .PHONY: test-cover-html | |
| PACKAGES = $(shell find ./ -type d -not -path '*/\.*') | |
| test-cover-html: | |
| echo "mode: count" > coverage-all.out | |
| $(foreach pkg,$(PACKAGES),\ | |
| go test -coverprofile=coverage.out -covermode=count $(pkg);\ | |
| tail -n +2 coverage.out >> coverage-all.out;) | |
| go tool cover -html=coverage-all.out |
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
| # Ref: https://wiki.archlinux.org/index.php/CUE_Splitting | |
| shnsplit -f audio.cue -t "%n. %p - %t" -o flac audio.flac | |
| cuetag.sh audio.cue [01]*.flac |
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
| // Ref: http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en | |
| apply plugin: 'com.android.library' | |
| ext { | |
| bintrayRepo = 'maven' | |
| bintrayName = 'fb-like' | |
| publishedGroupId = 'com.inthecheesefactory.thecheeselibrary' | |
| libraryName = 'FBLike' |
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
| // https://tonicdev.com/56fde983d60906110030ba19/56fde983d60906110030ba1a | |
| var soap = require('soap'); | |
| var url = 'http://www.webservicex.net/geoipservice.asmx?WSDL'; | |
| var args = {IPAddress: '8.8.8.8'}; | |
| soap.createClient(url, function(err, client) { | |
| client.GetGeoIP(args, function(err, result) { | |
| console.log(result.GetGeoIPResult); | |
| }); | |
| }); |
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 | |
| DATE="date +%Y%m%d%H%M%S" | |
| RDATE="date +%Y%m%d%H%M%S" | |
| IP='curl icanhazip.com' | |
| ENTROPY='cat /proc/sys/kernel/random/entropy_avail' | |
| LOG='heroku-entropy.log' | |
| touch $LOG | |
| while true; do | |
| heroku run "echo \"$($DATE),\$($RDATE),\$($IP),\$DYNO,\$($ENTROPY)\"" 2>&1 | egrep "^20" >> $LOG; | |
| done |
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
| func Round(a float64) float64 { | |
| if a < 0 { | |
| return math.Ceil(a - 0.5) | |
| } | |
| return math.Floor(a + 0.5) | |
| } |
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
| // Deps: lodash (or Underscore.js) | |
| !function(global, appname) { | |
| 'use strict'; | |
| var ng = angular.module(appname); | |
| ng.config([ '$controllerProvider', '$compileProvider', '$filterProvider', '$provide', function($controllerProvider, $compileProvider, $filterProvider, $provide) { | |
| // Register 'ngLazy' globally to allow registering of components after bootstrap. | |
| // Eg: | |
| // ngLazy.controller('myController', function($scope) { | |
| // ... |
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
| telnet 25 | |
| helo example.com | |
| -250 OK | |
| mail from: | |
| -250 OK - mail from | |
| rcpt to: | |
| -250 OK - Recipient | |
| data | |
| -354 Send data. End with CRLF.CRLF | |
| To: |
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
| kernel /vmlinuz root=/dev/sdX ro rootfsflags=subvol=<subvolume name> |
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
| mount --bind /proc /mnt/sysimage/proc | |
| mount --bind /dev /mnt/sysimage/dev | |
| mount --bind /sys /mnt/sysimage/sys | |
| chroot /mnt/sysimage | |
| cd /boot | |
| mv initrd.img initrd.old.img | |
| mkinitrd initrd-<ver>.img <ver> | |
| cd / | |
| sync; sync; sync |