Skip to content

Instantly share code, notes, and snippets.

View dotemacs's full-sized avatar

Александар Симић dotemacs

View GitHub Profile
+SECURITY WARNINGS+
+------------+-------+--------+-----------------+-----------------------------------------------------------------------+
| Confidence | Class | Method | Warning Type | Message |
+------------+-------+--------+-----------------+-----------------------------------------------------------------------+
| High | | | Session Setting | Session secret should not be included in version control near line 17 |
+------------+-------+--------+-----------------+-----------------------------------------------------------------------+
#!/bin/sh
# dump fields in a pdf document
# 21 November 2013
pdftk ${1} dump_data_fields
#!/usr/bin/env ruby
require 'prawn'
Prawn::Document.generate("./done.pdf", :template => "./form.pdf") do |pdf|
pdf.stroke do
pdf.line_width = 2
pdf.line [300,200], [100,600]
end
end

Simple Salt tutorial

This tutorial aims to show you how to install Salt and perform a basic task of creating a file and managing it's content. At first it will do it all using a simple formula and afterwards it will show you how to use a pillar.

The tutorial assumes that you'll be using Vagrant. If that is not the case, skip the first two sections.

{
"input": "form.pdf",
"output": "blah.pdf",
"strikes": [
{ "page": 2, "x": 267, "y": 557, "x1": 40, "y1": 0, "thickness": 2 },
{ "page": 2, "x": 309, "y": 557, "x1": 37, "y1": 0, "thickness": 2 }
]
}
# test the app manually
curl -H "Accept: application/json" \
-X POST \
-H "Content-Type: application/json" \
-d @scripts/strikes.json http://localhost:4000/
{
"input": "/Users/alex/dev/cc/strike2/form.pdf",
"output": "/Users/alex/dev/cc/strike2/blah.pdf",
"strikes": [
{ "page": 2, "x": 267, "y": 557, "x1": 40, "y1": 0, "thickness": 2 },
{ "page": 2, "x": 309, "y": 557, "x1": 37, "y1": 0, "thickness": 2 }
]
}
find /tmp/ -print -mmin +30 | xargs file | grep PDF | awk '{print $1}' | sed 's/://' | xargs rm -rf:
cron.present:
- user: root
$ vagrant provision
Done.
==> default: Running provisioner: salt...
Copying salt minion config to vm.
Uploading minion keys.
Checking if salt-minion is installed
salt-minion found
Checking if salt-call is installed
salt-call found
@dotemacs
dotemacs / README.md
Last active August 29, 2015 14:02
README for motion-persistable

Motion::Persistable

Persistable attributes for Rubymotion classes

A nice wrapper around Bubble-wrap's App::Persistence module that adds class macros for attributes that are persistable

Installation

Add this line to your application's Gemfile: