Skip to content

Instantly share code, notes, and snippets.

@first-developer
first-developer / docx2pdf
Created February 11, 2016 13:16 — forked from diogo-almeida/docx2pdf
Batch .docx conversion to .pdf using LibreOffice from the command line
# Path of LibreOffice installation
cd /Applications/LibreOffice.app/Contents/MacOS
# General command
./soffice --headless --convert-to <extension> <path+file>
# Automatically convert all .odt files to pdf
./soffice --headless --convert-to pdf ~/Downloads/*.odt
# To specify an output folder you can add the --outdir option
@first-developer
first-developer / _cursor-mixins.scss
Created November 14, 2015 23:50 — forked from laurendorman/_cursor-mixins.scss
Sass mixins + classes for cursors – For use with online photo editors, drag/drop tools, text editors and WYSIWYGs.
// Used to @include a cursor within a pre-existing class
@mixin cursor($cursor-type) {
cursor: $cursor-type;
}
// Used to generate cursor classes
@mixin cursor-class($cursor-type) {
.#{$cursor-type}-cursor { cursor: $cursor-type; }
}
@first-developer
first-developer / influxdb-grafana-howto.sh
Last active August 29, 2015 14:26 — forked from otoolep/influxdb-grafana-howto.sh
Shell script to download, and configure, InfluxDB, nginx, and Grafana
#!/bin/bash
# Check out the blog post at:
#
# http://www.philipotoole.com/influxdb-and-grafana-howto
#
# for full details on how to use this script.
AWS_EC2_HOSTNAME_URL=http://169.254.169.254/latest/meta-data/public-hostname
INFLUXDB_DATABASE=test1
@first-developer
first-developer / parse_x509.go
Created July 30, 2015 12:11
How to parse multiple DER certificate using x509.ParseCertificates
package main
import (
"crypto/x509"
"fmt"
"encoding/pem"
)
func main() {
{
"snippets": [
{
"match": {"global": true, "pkgname": ".", "fn": ".*_test.go"},
"snippets": [
{"text": "func Test", "title": "", "value": "func Test${1:ObjectName}${2:TestName}(t *testing.T) {\n\t$0\n}"},
{"text": "func Benchmark", "title": "", "value": "func Benchmark${1:ObjectName}${2:BenchmarkName}(b *testing.B) {\n\n\tb.StopTimer()\n\n\t$0\n\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\t\n\t}\n\n}"},
{"text": "func Example", "title": "", "value": "func Example${1:ObjectName}${2:ExampleName}() {\n\n\t$0\n\n\t// Output:\n\t// \n\n}"}
]
}
@first-developer
first-developer / httpd_avg_size.bash
Created July 29, 2015 11:37
Return the average memory size of httpd processes running on a server
#!/bin/bash
# --------------------------------------------------------------------------
# Script : httpd_avg_mem_size
# Created on : 27/07/2015
# Copyright : (c) 2015 - fdsolutions
# --------------------------------------------------------------------------
usage(){
@first-developer
first-developer / zsh.md
Last active August 29, 2015 14:25 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@first-developer
first-developer / jvmgc.go
Last active August 29, 2015 14:22
go script to parse JVM GC log
// jummy project main.go
package main
import (
"fmt"
"regexp"
"time"
)
const (
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
cd /tmp
curl -O https://ftp.gnu.org/gnu/bash/bash-4.3.30.tar.gz
tar xzf bash-4.3.30.tar.gz
cd bash-4.3.30/
./configure --prefix=/usr/local/bin && make && sudo make install
/*
// Usage:
gulp.task('docs', function(cb) {
gulp.src('path/to/your/src')
.pipe(hologram(cb));
});
*/
var gulp = require('gulp'),
notify = require('gulp-notify'),