Skip to content

Instantly share code, notes, and snippets.

View kirikintha's full-sized avatar

Paul T Huntsberger kirikintha

View GitHub Profile
@kirikintha
kirikintha / gist:159c1101e41e920327e6d015ce5b7bdb
Created January 12, 2020 19:14
arm-template-parameters-definition.json - For adding in Function App to parameters for CI
{
"Microsoft.DataFactory/factories/pipelines": {},
"Microsoft.DataFactory/factories/integrationRuntimes": {
"properties": {
"typeProperties": {
"ssisProperties": {
"catalogInfo": {
"catalogServerEndpoint": "=",
"catalogAdminUserName": "=",
"catalogAdminPassword": {
@kirikintha
kirikintha / states_counties.js
Created April 13, 2016 13:47
This is a javascript list of states and their counties
var statesProvinces: [{
name: 'Alabama',
id: 'AL',
counties: [
"Autauga County",
"Baldwin County",
"Barbour County",
"Bibb County",
"Blount County",
"Bullock County",
@kirikintha
kirikintha / development.js
Created November 5, 2014 22:38
Sample Winston Logger Config File (Winston configuration values only)
'use strict';
module.exports = {
//Winston Logging variables.
winston: {
//Transport Type (none|mail|sns|mongo|paperTrail)
transport: 'none',
//Mail Transport via SMTP
mail: {
to: 'example@example.com',
@kirikintha
kirikintha / winston-logger.js
Last active August 29, 2015 14:08
Sample Winston transport examples, using meanjs, express and a config file (not supplied)
'use strict';
/**
* Module Dependencies
* @type type
*/
var winston = require('winston');
var mail = require('winston-mail').Mail;
var sns = require('winston-sns').SNS;
var mongo = require('winston-mongodb').MongoDB;
@kirikintha
kirikintha / gist:cf5446f4c7bbcf6bf87a
Created September 17, 2014 03:26
PHP ISO Countries Valid for September 2014
<?php
/**
* ISO Countries
* Last Updated: September 16, 2014
*/
$locations = array(
'AFG' => array(
'name' => 'Afghanistan',
@kirikintha
kirikintha / laravel-detect-env
Created May 4, 2014 00:28
Laravel Environment Detection For Mac
/*
|--------------------------------------------------------------------------
| Detect The Application Environment
|--------------------------------------------------------------------------
|
| Laravel takes a dead simple approach to your application environments
| so you can just specify a machine name for the host that matches a
| given environment, then we will automatically detect it for you.
|
*/
@kirikintha
kirikintha / gist:8477629
Created January 17, 2014 17:30
This is a quick example of implementing a very generic Drupal behavior. They key here is to use attach. Drupal behaviors can be a tad maddening, but because it is in a closure, you don't have to use $(document).ready(); Instead of using the location or mapping modules for maps, we output the markers through our module, based on the Geo Field API.
/*
* My Module Api JS.
*/
(function ($) {
//Property Api Behavior
Drupal.behaviors.myModuleApi = {
attach: function (context, settings) {
//Check for Geo Location.
context = $('body.page-search-properties');
if (context.length > 0) {
@kirikintha
kirikintha / gist:8477420
Created January 17, 2014 17:18
This is just a quick example of using the drupal hook_library. For "vendor" libraries, but those into your /sites/all/libraries path, however for this particular example, using google maps, we have two files that that are needed to invoke the google maps v3 api. This puts everything into the footer, in order and allows Drupal to aggregate the fi…
**
* Implements hook_library
*/
function my_module_api_library() {
//Google API key.
$key = 'mygoogleapikey';
$libraries = array();
$libraries['my-module'] = array(
'title' => 'My Module',
'website' => 'http://my-site.localhost',
@kirikintha
kirikintha / gist:8408127
Created January 13, 2014 21:04
Bootstrap 3 has-error to error conversion for CakePHP. We cannot change the error class, so use this and you get bootstrap's styling on form errors.
/*
Cake PHP's Form Helper will not allow use to use the has-error class, and wrap
the form elements properly, so we update their CSS to use the .error class.
*/
.error .help-block,
.error .control-label,
.error .radio,
.error .checkbox,
.error .radio-inline,
.error .checkbox-inline {
@kirikintha
kirikintha / ManifestFragment.java
Created December 30, 2013 18:19
Suggestions Adapter - not generic, just for reference sake
//Create a cursor for suggestions.
@Deprecated
private void createSuggestions (String characters) {
suggestionsCursor = new MatrixCursor(columnNames);
int suggestionId = 0;
for (Manifests country : countries) {
String name = country.getName();
String check = name.toLowerCase();
if (check.startsWith(characters.toLowerCase())) {
//Create suggestions.