Skip to content

Instantly share code, notes, and snippets.

@airways
airways / config_SLASH_site.php
Last active August 29, 2015 14:20
FuelCMS "site" module with custom datatypes ("modules") setup
<?php
/*
|--------------------------------------------------------------------------
| FUEL NAVIGATION: An array of navigation items for the left menu in the admin
|--------------------------------------------------------------------------
*/
$config['nav']['site'] = array(
'site/articles' => lang('module_site_articles'),
@airways
airways / export_csv.php
Last active December 7, 2015 14:37 — forked from apocratus/export_csv.php
Export MySQL to CSV (php script)
<?php
// database table to be exported
$db_table = 'XXXXXXXXX';
// optional where query
$where = 'WHERE 1 ORDER BY 1';
// filename for export
$csv_filename = 'db_export_'.$db_table.'_'.date('Y-m-d').'.csv';
// database variables
$hostname = "localhost";
@airways
airways / index.html
Last active October 8, 2015 14:15
Basic ProForm 1.64 Example template -- Example URL: example.com/forms/contact_us -- Place into forms.group template directory
{exp:proform:form form_name="{segment_2}" variable_prefix="pf_"}
{if pf_no_results}
{if pf_pref:invalid_form_message}
{pf_pref:invalid_form_message}
{if:else}
Invalid form name specified!
{/if}
{/if}
{if pf_complete}
{if pf_pref:thank_you_message}
<script type="text/javascript" >
// So the JS knows where our files are
var site_url = "{site_url}";
</script>
{!-- The AJAX code should work with the default HTML generated by the simple form tag: --}
{exp:proform:simple form_name="contact_us"}
<script type="text/javascript" src="http://localhost/index.php//assets/js/contact_us.js"></script>
@airways
airways / index.html
Created October 8, 2015 14:16
Basic ProForm 1.65+ Example template -- Example URL: example.com/forms/contact_us -- Place into forms.group template directory
{exp:proform:form form_name="{segment_2}" variable_prefix="pf_" error_delimiters="|"}
{pf_formpref:html_prefix}
{if pf_no_results}
{if pf_pref:invalid_form_message}
{pf_pref:invalid_form_message}
{if:else}
Invalid form name specified!
{/if}
{/if}
@airways
airways / notification.html
Created August 3, 2016 18:49
Basic ProForm notification template
{fields}
{if field_type != "hidden"}
{field_label}: {field_value}
{/if}
{/fields}
@airways
airways / IOHelper.php
Last active July 30, 2018 08:29
Custom hook to allow plugins for Craft CMS to inject custom "file kinds" into IOHelper. Patch is at very end of snipped IOHelper.php. Example plugin hook at end of YourPlugin.php
<?php
namespace Craft;
/**
* Class IOHelper
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @copyright Copyright (c) 2014, Pixel & Tonic, Inc.
* @license http://craftcms.com/license Craft License Agreement
* @see http://craftcms.com

Keybase proof

I hereby claim:

  • I am airways on github.
  • I am airways (https://keybase.io/airways) on keybase.
  • I have a public key ASA3E-SpXPxLruHW3Az8XZ56s7rQszUvQQt5Pe2UPaKa_Qo

To claim this, I am signing this object:

@airways
airways / ppp.sh
Created June 30, 2017 22:19
Start pppd if ethernet connection has no network, kill it if ethernet comes up
#!/bin/sh
CONNECTION=1
while [ 1 ]
do
if ping -q -c 1 -w 1 -I eth0 google.com > /dev/null ; then
if [ $CONNECTION -eq 0 ] ; then
echo "Ethernet connection is up, killing pppd"
killall pppd
@airways
airways / softsalefile-to-license.php
Created April 15, 2020 17:05 — forked from cgi-caesar/softsalefile-to-license.php
Soft File to License Scheme Plugin
<?php
/**
* @title Soft File to License Scheme
* @path application/default/plugins/misc/softsalefile-to-license.php
*/
class Am_Plugin_SoftsalefileToLicense extends Am_Plugin
{
const PLUGIN_STATUS = self::STATUS_PRODUCTION;