Skip to content

Instantly share code, notes, and snippets.

View axolx's full-sized avatar
🐝

Martin Rio axolx

🐝
View GitHub Profile
@g-a-d
g-a-d / gist:4bc7f716bc57e42b64e1ef450be9bae8
Created November 6, 2017 15:41
Converting CloudFormation parameter files to CodePipeline Template Configuration files
Using jq, we can convert between CloudFormation parameter files and CodePipeline template configuration files:
$ jq '{ Parameters: [ .[] | { (.ParameterKey): .ParameterValue } ] | add } ' < cloudformation_parameter_file.json
This is useful in the case of receiving 'Template configuration is not valid' when running a CloudFormation action.
A CloudFormation parameter file has format:
[
{
@kukat
kukat / custom.css
Last active November 14, 2016 13:49
nvAlt with code highlight template.html
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@EvanLovely
EvanLovely / iPhone-orientation-change.js
Created August 13, 2012 23:04
reset scaling on iPhones on orientation change
// reset scaling on iPhones on orientation change. author: @axolx
if (navigator.userAgent.match(/iPhone/i)) {
$(window).bind('orientationchange', function(event) {
$('meta[name="viewport"]').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0');
$(window).resize();
}).trigger('orientationchange');
}
@EvanLovely
EvanLovely / iPad-Orientation-Change.js
Created August 13, 2012 23:01
reset scaling on iPads on orientation change
// reset scaling on iPads on orientation change. author: @axolx
if (navigator.userAgent.match(/iPad/i)) {
$(window).bind('orientationchange', function(event) {
if (window.orientation == 90 || window.orientation == -90 || window.orientation == 270) {
$('meta[name="viewport"]').attr('content', 'height=device-width,width=device-height,initial-scale=1.0,maximum-scale=1.0');
$(window).resize();
} else {
$('meta[name="viewport"]').attr('content', 'height=device-height,width=device-width,initial-scale=0.8,maximum-scale=0.8');
$(window).resize();
}
@alganet
alganet / autoloader.php
Created May 10, 2011 14:18
Lightweight PSR-0 compliant autoloader
<?php
spl_autoload_register(function ($className) {
$fileParts = explode('\\', ltrim($className, '\\'));
if (false !== strpos(end($fileParts), '_'))
array_splice($fileParts, -1, 1, explode('_', current($fileParts)));
require implode(DIRECTORY_SEPARATOR, $fileParts) . '.php';
});
class default_node {
package { 'apache2':
ensure => installed
}
service { 'apache2':
ensure => true,
enable => true,
require => Package['apache2'],
}
}