// Not much of PHP magic
// This just takes a PDF file from a path
// and executes Ghostscript to convert your
// PDF to version 1.4
// You need to have Ghostscript installed
// See https://www.ghostscript.com/Documentation.html
$PDFFile = '/path/to/your/pdf.pdf';
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* FastLED_RGBW | |
* | |
* Hack to enable SK6812 RGBW strips to work with FastLED. | |
* | |
* Original code by Jim Bumgardner (http://krazydad.com). | |
* Modified by David Madison (http://partsnotincluded.com). | |
* Modified by Christof Kaufmann. | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cid = 1417698146920752799; //CID of a place can be genrated from https://pleper.com/index.php?do=tools&sdo=cid_converter | |
//execute curl | |
$url = 'https://maps.googleapis.com/maps/api/place/details/json?cid='.$cid.'&key=<API-KEY>'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HEADER, false); | |
$data = curl_exec($ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
START_TIME=$SECONDS | |
set -e | |
echo "-----START GENERATING HLS STREAM-----" | |
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME] | |
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1 | |
# comment/add lines here to control which renditions would be created | |
renditions=( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Circular loader ring (a real basic one) | |
* | |
* By: Andrew Tuline | |
* | |
* Date: May, 2019 | |
* | |
* One version uses a loop and fixed colours, while the other uses a fader. | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The drupal_set_message() function is being deprecated! | |
// @see https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/drupal_set_message/8.5.x | |
// > Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. | |
// > Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. | |
// In some custom code. | |
\Drupal::messenger()->addMessage('Say something else'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# download | |
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
# unzip | |
unzip ngrok-stable-linux-amd64.zip | |
# move to /usr/local/bin | |
sudo mv ngrok /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Drupal\Core\Entity\EntityStorageInterface; | |
+use Drupal\Core\Entity\RevisionableContentEntityBase; | |
use Drupal\Core\Field\BaseFieldDefinition; | |
use Drupal\Core\Entity\ContentEntityBase; | |
use Drupal\Core\Entity\EntityChangedTrait; | |
@@ -19,6 +20,7 @@ | |
* @ContentEntityType( | |
* id = "restaurant", | |
* label = @Translation("Restaurant"), | |
+ * show_revision_ui = TRUE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Remove rubberband scrolling from web apps on mobile safari and standalone (iOS)</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-touch-fullscreen" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | |
<style> | |
html, body {margin: 0; padding: 0; width:100%; height:100%; overflow: hidden; background: #333} | |
p.center { |
NewerOlder