Skip to content

Instantly share code, notes, and snippets.

@talkingnews
talkingnews / ffmpeg_build.sh
Last active February 10, 2023 20:22 — forked from iJackUA/ffmpeg_build.sh
Build ffmpeg and all needed codecs from latest git revisions
#!/bin/bash
sudo apt-get update -qq && sudo apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
@talkingnews
talkingnews / dateTimeFormats.js
Last active November 20, 2018 12:36
Various useful javascript date and time formats
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString
const startDate = new Date()
//2018-11-20T11:33:57.788Z
const yyyymmdd = startDate.toISOString().slice(0, 10);
//'2018-11-20'
const startTimeWithSeconds = startDate.toLocaleTimeString();
//'11:33:57 AM'
@talkingnews
talkingnews / js-tricky-bits.md
Created January 5, 2018 23:14 — forked from amysimmons/js-tricky-bits.md
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@talkingnews
talkingnews / sources.list
Created October 31, 2014 19:10
sources.list from troublesome update machine
#
# deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release i386 (20140416.2)]/ trusty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.digitalocean.com/ubuntu/ trusty main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.digitalocean.com/ubuntu/ trusty-updates main restricted
@talkingnews
talkingnews / multiformtest.txt
Created September 21, 2012 19:20
multiform test
{{ streams:form stream="tracks" mode="edit" edit_id="137" include="track_name" }}
{{ form_open }}
{{ fields }}
{{ track_name }}{{ error }}{{ input }}
{{ /fields }}
{{ form_submit }}
{{ form_close }}
@talkingnews
talkingnews / pyro_outh2.php
Created September 7, 2012 15:13
Pyrocms Google URL shortener and the oAuth2 conundrum
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Plugin_Googleshort extends Plugin
{
const CLIENT_ID = 'xxxxx.apps.googleusercontent.com';
const SERVICE_ACCOUNT_NAME = 'xxxxx@developer.gserviceaccount.com';
const KEY_FILE = 'xxxxx-privatekey.p12';
function shorten()
@talkingnews
talkingnews / pyrocmsforumbugs
Created September 2, 2012 14:34
Pyrocms forums buglist
-------------- Comments within tags ------------
Comments within tags do not show in PyroCMS
{{# This is a comment #}}
Try wrapping that in noparse:
{{ noparse }}
{{# This is a comment #}}
{{ /noparse }}
@talkingnews
talkingnews / .htaccess
Created August 21, 2012 21:48
htaccess which comes with Pyrocms Pro
# Multiple Environment config
# Set this to development, staging or production
# SetEnv PYRO_ENV production
<IfModule mod_rewrite.c>
# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on
@talkingnews
talkingnews / nginx_pyrocms_pro_config
Created August 21, 2012 21:47
Nginx config file working with pyrocms pro.
server {
listen x.x.x.x:80;
server_name mysite.co.uk *.mysite.co.uk;
root /var/www/mysite.co.uk/web/pyrocms-professional;
index index.php;
error_log /var/www/mysite.co.uk/error.log;
access_log /var/www/mysite.co.uk/access.log combined;
@talkingnews
talkingnews / lextagnoparse
Created July 11, 2012 10:52
Lex tag parser noparse question
Pyrostreams loop and single tests. <br />
<br />
Note: You can prevent parsing of Lex tags with <br /><br />
{{ noparse }}
<br />{{ noparse }}
Hello, {{ name }}!
{{ /noparse }}
{{ /noparse }}<br /><br />
I would expect the following code to output the most recent entries (which were entered as "one", "two", "three" etc) to output the most recent 5 items: