Skip to content

Instantly share code, notes, and snippets.

@yevrah
yevrah / crud_template.pl
Created September 5, 2017 23:25
Perl: App.pm Example
#!/usr/bin/env perl
# Sane defaults
require 5.004;
use strict 'vars';
use warnings;
use diagnostics;
use CGI::Carp qw(fatalsToBrowser);
# Stadard libaries
@yevrah
yevrah / crud_template.pl
Created September 5, 2017 23:25
Perl: App.pm Example
#!/usr/bin/env perl
# Sane defaults
require 5.004;
use strict 'vars';
use warnings;
use diagnostics;
use CGI::Carp qw(fatalsToBrowser);
# Stadard libaries
@yevrah
yevrah / data_sections.pl
Created July 7, 2017 05:26
PERL: Multiple data sections
#!/usr/bin/env perl
# Sane defaults
use strict;
use warnings;
use feature qw/say/;
use Data::Dumper;
my @data = <DATA>;
@yevrah
yevrah / centos.repo
Last active April 7, 2017 00:42
LINUX: Add Centos Packages to Redhat 5.8
# vim /etc/yum.repos.d/centos.repo
#
# Adding the following contents, note the ‘5’ has to be hardcoded to either 5 or 6 depending on your RHEL version.
#
[centos]
name=CentOS $releasever - $basearch
baseurl=http://ftp.heanet.ie/pub/centos/5/os/$basearch/
enabled=1
gpgcheck=0
@yevrah
yevrah / integration.js
Created August 18, 2016 00:57
JAVSCRIPT: Angular and Phaser Integration
// Namespace declarations
var wingaru = wingaru || {};
var wingaru.auth = wingaru.auth || {};
var wingaru.games = wingaru.games || {};
var wingaru.activites = wingaru.acivities || {};
var wingaru.videos = wingaru.videos || {};
//
// Generic Helper
//
@yevrah
yevrah / api.cs
Created August 17, 2016 03:02
CC: API Connection in CSharp
using System;
using System.IO;
using System.Net;
using System.Text; // for class Encoding
namespace ClassCover.Api.Example
{
public class API
{
@yevrah
yevrah / quicktime_screencast_prep.sh
Created June 9, 2016 01:02
FFMPEG: Reduce QuickTime Screencast Filesize
#!/usr/bin/bash
ffmpeg -i SCRUM-2016-06-08.mov -vf scale=1024x768,setdar=16:9 -c:v libx264 -preset slow -profile:v main -crf 20 output-1024.mp4
@yevrah
yevrah / productionalise.sh
Created April 26, 2016 04:21
Bash: Productionalise
#!/bin/bash
# Take a snopshot of code and sym link it to a published apached location
# Created By: Javier Woodhouse
user=$1
symbolic_path=$2
source=$3
date_part=`date +"%Y%m%d-%I%M%S"`
destination="$user.$date_part"
@yevrah
yevrah / productionalise.sh
Created April 26, 2016 04:21
Bash: Productionalise
#!/bin/bash
# Take a snopshot of code and sym link it to a published apached location
# Created By: Javier Woodhouse
user=$1
symbolic_path=$2
source=$3
date_part=`date +"%Y%m%d-%I%M%S"`
destination="$user.$date_part"
@yevrah
yevrah / apache_mem.sh
Last active November 24, 2015 05:33
Apache: Mem Summary
#!/bin/bash
printf "\nMemory Status\n"
ps aux | grep '^apache' | awk '{print $1, $2, $11, $6/1024 " MB";}'
printf "\nSum: "
ps aux | grep '^apache' | awk '{sum+= $6;} END {print sum/1024 " MB";}'
printf "Average: "
ps aux | grep '^apache' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB";}'