Skip to content

Instantly share code, notes, and snippets.

View derak-kilgo's full-sized avatar

Derak Kilgo derak-kilgo

View GitHub Profile
@derak-kilgo
derak-kilgo / blti-launch.php
Created January 6, 2016 16:43 — forked from matthanger/blti-launch.php
Sample code for Basic LTI Consumer in PHP
<?php
# ------------------------------
# START CONFIGURATION SECTION
#
$launch_url = "http://www.imsglobal.org/developers/BLTI/tool.php";
$key = "12345";
$secret = "secret";
$launch_data = array(
@derak-kilgo
derak-kilgo / vine_to_gif.rb
Created August 17, 2016 18:27 — forked from seyhunak/vine_to_gif.rb
Vine.co mp4 to GIF using Ruby
# space150 vine-to-GIF
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it
# requires ruby, ffmpeg, and imagemagick
require 'open-uri'
require 'nokogiri'
id = ARGV[0]
# try to convert from URL to id.
@derak-kilgo
derak-kilgo / matrixish.sh
Created August 17, 2016 19:30 — forked from ttscoff/matrixish.sh
A Matrix-ish display for Bash terminal
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"
@derak-kilgo
derak-kilgo / convert.php
Created August 22, 2016 13:00 — forked from anonymous/convert.php
Batch resize images with ImageMagick ( and php )
<?php
//path to image magick
$convert = '/usr/local/bin/convert';
$source = __DIR__ . '/all_images';
$dest = __DIR__ . '/resize';
$quality = 95; // 1-100 ; 92 is default.
$maxSize = 3680; //in pixels
@derak-kilgo
derak-kilgo / gist:84d5e16c93ebfab4df340f513a97209f
Created May 2, 2017 19:11 — forked from thiamteck/gist:2324779
MySql random word function based on Lorem Ipsum text
DROP FUNCTION IF EXISTS random_word;
CREATE FUNCTION random_word ()
RETURNS TEXT
RETURN (ELT( FLOOR(1 + (RAND() * (100-1))),
'Lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'Integer', 'nec',
'odio', 'Praesent', 'libero', 'Sed', 'cursus', 'ante', 'dapibus', 'diam', 'Sed', 'nisi',
'Nulla', 'quis', 'sem', 'at', 'nibh', 'elementum', 'imperdiet', 'Duis', 'sagittis', 'ipsum',
'Praesent', 'mauris', 'Fusce', 'nec', 'tellus', 'sed', 'augue', 'semper', 'porta', 'Mauris',
'massa', 'Vestibulum', 'lacinia', 'arcu', 'eget', 'nulla', 'Class', 'aptent', 'taciti', 'sociosqu',
@derak-kilgo
derak-kilgo / divi-disable-maps.php
Created July 10, 2018 20:36 — forked from lots0logs/child-functions.php
WordPress :: Divi Builder :: Disable Google Maps
<?php
/**
* @package Divi_Disable_Maps
* @version 1.0
*/
/*
Plugin Name: Divi Disable Maps
Description: Enable only if you are not using the map module. Fixes "Google Maps JavaScript API warning: NoApiKeys" wanring in the console.
Author: lots0logs
Author URI: https://gist.github.com/lots0logs/67d639070dc54505eef1
@derak-kilgo
derak-kilgo / slack-night-mode-custom.css
Last active February 13, 2019 15:11 — forked from sandheepgr/slack-night-mode-custom.css
Night mode css file for slack
body { background: #404040; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #404040; }
@derak-kilgo
derak-kilgo / md5.js
Created September 17, 2019 16:09 — forked from vor0nwe/md5.js
/*
* http://www.myersdaily.org/joseph/javascript/md5-text.html
*/
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
@derak-kilgo
derak-kilgo / rd-class-text-extraction.php
Created August 4, 2020 22:48 — forked from nickrouty/rd-class-text-extraction.php
Class for extraction the text from doc, docx, xlsx, pptx and wrapper for 3rd party pdf to text library.
<?php
/**
* Class RD_Text_Extraction
*
* Example usage:
*
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file);
*
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class.