In PHP
<?php
$vars = [
'name' => 'Loz'
];
$template = 'Hello {{ name }}!';
In PHP
<?php
$vars = [
'name' => 'Loz'
];
$template = 'Hello {{ name }}!';
// asyncDirListNaturalSort.js | |
const path = require('path') | |
const fs = require('fs') | |
/** | |
* Asynchronous load list of files from directory, | |
* - with optional extensions filtering and natural sort | |
* | |
* @param {string} dirPath directory path to folder |
Make sure got volatile keys in config:
lxc config edit my-borked-container
Lookout for these, if they are missing adding them and restarting the container should fix it.
volatile.idmap.base: "0"
const crypto = require("crypto"); | |
/** | |
* AES CBC Encryption helper | |
* | |
* Usage: | |
* ``` javascript | |
// | |
const encryption = require('@lib/encryption'); |
.social_wrapper2, | |
.social_youtube, | |
.socialaccounts, | |
.socialakamai, | |
.socialarea, | |
.socialb, | |
.socialb_tg, | |
.socialbadge, | |
.socialbar-mobile, | |
.socialbar-wrap-bottom, |
<?php | |
// https://stackoverflow.com/questions/52348639/how-to-generate-a-recursive-list-of-directories-and-files-with-hyperlinks-to-eac/52348780#52348780 | |
function file_get_listing($path = '') | |
{ | |
$return = []; | |
foreach (new IteratorIterator(new DirectoryIterator($path)) as $item) { | |
if ($item->isDot()) { | |
continue; | |
} | |
$info = [ |
<?php | |
function isPrime($number) { | |
$n = abs($number); | |
$i = 2; | |
while ($i <= sqrt($n)) { | |
if ($n % $i === 0) { | |
return false; | |
} | |
$i++; |
// This will open up a prompt for text to send to a console session on digital ocean | |
// Useful for long passwords | |
(function () { | |
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
function f() { | |
var character = t.shift(); | |
var i=[]; | |
var code = character.charCodeAt(); | |
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).