Skip to content

Instantly share code, notes, and snippets.

@mckelvey
mckelvey / login_updates.css
Last active December 24, 2015 12:59
This application allows you to insert custom content underneath the login screen. Be sure to add accompanying CSS styles if needed.
/**
* Basic Login Updates Styles
* by White Whale Web Services
* http://whitewhale.net
* When using this file, place it in a /styles sub-folder of the module folder
* containing the above PHP file so that it can be found by the module code.
**/
/* Card Styles */
@mckelvey
mckelvey / file structure notes
Created September 28, 2012 00:40
Login Updates
\livewhale (backend)
\client
\modules
\login_updates
\private.application.login_updates.php (contents below)
\styles
\login_updates.css (contents below)
\core
...
@mckelvey
mckelvey / ISO-8895-15 to UTF-8
Created September 14, 2012 23:11
Character Conversion
function convertCharset($contents) {
iconv_set_encoding("internal_encoding", "ISO-8859-15");
iconv_set_encoding("output_encoding", "ISO-8859-1");
ob_start("ob_iconv_handler");
echo $contents;
$contents = ob_get_clean();
$contents = strtr($contents, array(
"\x80" => "e",
"\x81" => " ",
"\x82" => "'",
@mckelvey
mckelvey / public.application.public_notifier.php
Created July 20, 2012 18:15
PublicNotifier (LiveWhale Application Module)
<?php
$_LW->REGISTERED_APPS['public_notifier']=array(
'title'=>'PublicNotifier',
'handlers' => array('onAfterPublicSubmission')
);
class LiveWhaleApplicationPublicNotifier {
// These two arrays are for including the users and/or groups that
# GET /entries/:hashtag/receiver
# POST /entries/:hashtag/receiver.json
def receiver
if request.method == 'GET' and !params['hub.challenge'].blank? and params['hub.mode'] == 'subscribe'
if !params['hub.verify_token'].blank?
game = Game.find_by_token(params['hub.verify_token'])
if !game.nil? and game.hashtag == params[:hashtag]
render :status => 200, :text => params['hub.challenge']
else
InstagaMe::Log.rails "bad token match for #{params['hub.verify_token']}; returning status 406"
@mckelvey
mckelvey / master-git-ignore
Created November 21, 2010 17:10
This is my best case .gitignore file.
# Services #
############
*.sassc
.sass-cache
# Generic #
###########
/log/*
/tmp/*
/pids/*