Skip to content

Instantly share code, notes, and snippets.

View marfarma's full-sized avatar

Pauli Price marfarma

View GitHub Profile
@chrislwade
chrislwade / redcar-wrapper.bash
Created March 21, 2011 04:40
This function wraps the Redcar launcher to set different options based on the current directory. I use this to detect when I'm working on Redcar itself or a plugin for Redcar and launching with debug log output redirected to STDOUT. Otherwise I launch
function redcar {
if [ -f plugin.rb ]; then
echo "Found 'plugin.rb'!"
echo "Assuming this directory is a Redcar plugin."
echo "Running with --show-log, --log-level=debug, and without --fork."
wrapped_redcar --show-log --log-level=debug $*
elif [ -f lib/redcar.rb ] && [ -f bin/redcar ]; then
echo "Found 'lib/redcar.rb' and 'bin/redcar'!"
echo "Assuming this is the Redcar application directory."
echo "Running with --show-log, --log-level=debug, and without --fork."
@meyerzinn
meyerzinn / IonicPush.md
Created October 5, 2015 02:38
Ionic Push

First, be sure to configure $ionicAppProvider (do so right after declaring the app module), like so:

app.config(['$ionicAppProvider', function($ionicAppProvider) {
  // Identify app
  $ionicAppProvider.identify({
    // Your App ID
    app_id: 'xxx',
    // The public API key services will use for this app
    api_key: '80xxxxxx',
    // Your GCM sender ID/project number (Uncomment if supporting Android)
@franz-josef-kaiser
franz-josef-kaiser / current_admin_info.php
Created September 13, 2012 01:25
Collect & display data from current admin screens contextual hooks and from which hook on some globals are available.
MOVED TO A REPO NOW: https://github.com/franz-josef-kaiser/current-admin-info
@Rarst
Rarst / backtrace-error-handler.php
Created October 4, 2012 19:31
Error handler with WordPress backtrace in message.
<?php
set_error_handler( 'backtrace_error_handler', error_reporting() );
function backtrace_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {
// handle @
if( 0 === error_reporting() )
return false;
@mrosset
mrosset / build
Last active December 10, 2015 02:38
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we dont use GOROOT_FINAL
export GOROOT="$OPENSHIFT_HOMEDIR/app-root/data/go"
@elimisteve
elimisteve / build
Last active December 10, 2015 11:29 — forked from mrosset/build
`build`, `start`, and `stop` scripts for getting Go web apps to run on OpenShift. Put these files in the `.openshift/action_hooks/` directory of your app.
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we don't use GOROOT_FINAL
mkdir -p $OPENSHIFT_HOMEDIR/app-root/data/go
@twilson63
twilson63 / app.js
Created May 4, 2013 01:40
ideablog app.js
var config = require('./config');
var nano = require('nano')(config.db);
var express = require('express');
var async = require("async");
var app = express();
var modelDoc = {
language: "javascript",
views: {
all: {
@scottmcarthur
scottmcarthur / Program.cs
Created January 23, 2014 12:00
Basic Authentication, Multiple repositories - ServiceStack v4
using System;
using System.Linq;
using ServiceStack;
using ServiceStack.Auth;
using ServiceStack.Web;
using System.Net;
using System.Text;
using System.Collections.Generic;
namespace Testv4
@scottmcarthur
scottmcarthur / CheckDatabaseModel.cs
Last active January 4, 2016 08:38
How to automatically detect database model changes in ServiceStack.OrmLite, and have the database update automatically.
public void CheckDatabaseModel(Type modelType)
{
// Get the referenced model version
string modelVersion = Assembly.GetAssembly(modelType).GetName().Version.ToString();
// Determine the last model version number from the configuration
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var lastModelVersion = config.AppSettings.Settings["DatabaseModelVersion"];
// Determine if the model has changed
@v-thomp4
v-thomp4 / gist:fb7d7a4dc9dc4c396a72
Last active March 21, 2016 21:14
Dockerizing an SSH Daemon Service

Dockerfile:

# sshd
#
# VERSION               0.0.2

FROM ubuntu:14.04
MAINTAINER Sven Dowideit <SvenDowideit@docker.com>

RUN apt-get update &amp;&amp; apt-get install -y openssh-server