Skip to content

Instantly share code, notes, and snippets.

@odixon
odixon / openssl_encrypt_decrypt.php
Created September 20, 2017 14:20 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@odixon
odixon / pdf-thumbnail-php.md
Created July 6, 2017 13:19 — forked from umidjons/pdf-thumbnail-php.md
Creating PDF thumbnails in PHP

Creating PDF thumbnails in PHP

Install Ghostscript

Download and install right version of ghostscript. In my case my PHP was x86 architecture, so I download Ghostscript 9.14 for Windows (32 bit).

Enable ImageMagick

@odixon
odixon / replace_master_w_branch
Created May 31, 2017 13:49 — forked from geekforbrains/replace_master_w_branch
Replace master with branch
git checkout <branch>
git merge -s ours master
git checkout master
git merge <branch>
@odixon
odixon / replace_master_w_branch
Created May 31, 2017 13:49 — forked from geekforbrains/replace_master_w_branch
Replace master with branch
git checkout <branch>
git merge -s ours master
git checkout master
git merge <branch>
@odixon
odixon / parseTime.js
Created February 10, 2017 20:07 — forked from claviska/parseTime.js
Parse time strings input by humans
function parseTime(time, format, step) {
var hour, minute, stepMinute,
defaultFormat = 'g:ia',
pm = time.match(/p/i) !== null,
num = time.replace(/[^0-9]/g, '');
// Parse for hour and minute
switch(num.length) {
case 4:
/**
* Vertically center Bootstrap 3 modals so they aren't always stuck at the top
*/
$(function() {
function reposition() {
var modal = $(this),
dialog = modal.find('.modal-dialog');
@odixon
odixon / meta-tags.md
Created January 3, 2017 20:18 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@odixon
odixon / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console