Skip to content

Instantly share code, notes, and snippets.

@theinvensi
theinvensi / pagedjs-repeat-table-header.js
Last active June 15, 2024 15:43
pagedjs-repeat-table-header
class RepeatTableHeadersHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller)
this.splitTablesRefs = []
}
afterPageLayout(pageElement, page, breakToken, chunker) {
this.chunker = chunker
this.splitTablesRefs = []
@dreikanter
dreikanter / encrypt_openssl.md
Last active May 2, 2024 12:55 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@craigminihan
craigminihan / Dockerfile
Last active August 1, 2016 22:50
A Dockerfile for creating an AvanceDB 0.1-alpha image
FROM debian:8.1
MAINTAINER Craig Minihan <craig@ripcordsoftware.com>
RUN apt-get update && apt-get install -y apt-utils wget
#RUN apt-get install -y libboost1.55
RUN apt-get install -y libboost-system1.55.0 libboost-filesystem1.55.0 libboost-thread1.55.0 libboost-date-time1.55.0 libboost-regex1.55.0 libboost-program-options1.55.0 libboost-chrono1.55.0
RUN adduser --disabled-password --gecos "" avancedb && cd ~avancedb && mkdir Downloads && cd Downloads && wget ftp://ftp.ripcordsoftware.com/pub/avancedb/avancedb-0.1.0-alpha-debian-8.x.tar.gz
RUN cd ~avancedb && mkdir bin && cd bin && tar xvfz ../Downloads/avancedb-0.1.0-alpha-debian-8.x.tar.gz
EXPOSE 5994
CMD su -c "cd ~/bin && ./avancedb" avancedb
@Verikon
Verikon / gist:20b7c0c22894384faa9c
Last active August 29, 2015 14:07
Using PaypalButtons - the online version.
document.addEventListener( 'DOMContentLoaded', function() {
var parentNode = document.querySelector('#paypalButon');
PAYPAL.apps.ButtonFactory.create( 'YOUR PAYPAL ID', {
button: { value: 'buynow' },
name: { value: 'Some Product' },
quantity: { value: '1' },
amount: { value: '5.99' },
currency: { value: 'AUD' },
@sawapi
sawapi / AppDelegate.swift
Last active October 25, 2023 09:26
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
@billyvg
billyvg / grunt-flo.js
Created May 28, 2014 23:56
grunt task for integrating with fb-flo
module.exports = function(grunt) {
// easy way to load grunt tasks in package.json
// require('load-grunt-tasks')(grunt);
// or the normal way
grunt.task.loadNpmTasks('grunt-concurrent');
grunt.task.loadNpmTasks('grunt-contrib-connect');
grunt.task.loadNpmTasks('grunt-contrib-watch');
// configure local dev server
grunt.config('connect.dev', {
@gustavohenke
gustavohenke / svg2png.js
Created February 18, 2014 15:27
SVG to PNG
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
@rlauck
rlauck / LICENSE.txt
Last active December 25, 2015 17:29 — forked from 140bytes/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@rjcorwin
rjcorwin / simple-file-attachment-for-couchdb.html
Created November 14, 2012 20:03
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
<!DOCTYPE html>
<! --
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
Log in at /_utils, upload this file to a document, and then view it for your own uploader. See the code for comments. ajaxSubmit() is the magic that attaches
as long as the Couch Doc exists because you can't submit a new Couch Document with an attachment.
by @rjsteinert http://rjsteinert.com
-->
<html xmlns="http://www.w3.org/1999/xhtml">
@MetaThis
MetaThis / server.js
Created August 25, 2011 22:03
Simple example of a Node.js proxy to CouchDB GET requests
var http = require('http'),
request = require('request'), // request module from https://github.com/mikeal/request
url = require('url');
http.createServer(function (req, res) {
var href = url.parse(req.url,true).href;
request('http://127.0.0.1:5984' + href).pipe(res);
}).listen(1337);
// now try something like http://127.0.0.1:1337/your_db_name/_all_docs/?limit=10