Skip to content

Instantly share code, notes, and snippets.

@riddla
riddla / gs-xpswd
Created June 11, 2019 11:23
remove password from pdf file using ghostscript
# Ghostscript command to remove the password from an encrypted pdf document.
# Replace ENCRYPTED.pdf with the path to your password protected pdf file.
# The unencrypted file is created as OUTPUT.pdf in the same directory.
# Install Ghostscript on the Mac with brew install gs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f ENCRYPTED.pdf
@riddla
riddla / index.html
Created November 6, 2017 08:15 — forked from kentcdodds/index.html
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@riddla
riddla / Layout.js
Created May 3, 2017 17:51 — forked from gustavlrsn/Layout.js
Example bootstrap 4 integration into Next.js, with the reactstrap package
import Head from 'next/head'
import { Container } from 'reactstrap'
const Layout = (props) => (
<div>
<Head>
<title>PairHub</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
</Head>
  1. Check if a page variable has been defined
    1. Set variables in a page (page.html.haml) at the very biginning of the file:

      ---
      variable: value
      variable2: value 2
      ---
helpers do
def buffer()
@_out_buf
end
def capture(buffer)
pos = buffer.size
yield
buffer.slice!(pos..buffer.size)
end
def my_helper(&block)
/*!
* JavaScript preload() function
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Demo: http://mathiasbynens.be/demo/javascript-preload
*/
function preload(arr) {
var i = arr.length,