Skip to content

Instantly share code, notes, and snippets.

View marfarma's full-sized avatar

Pauli Price marfarma

View GitHub Profile
@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)
--==============================
-- Send Keynote Text to Desktop Markdown File
-- Writted By: Richard Dooling https://github.com/RichardDooling/
-- Based on
-- Send Keynote Presenter Notes to Evernote
-- Version 1.0.1
-- Written By: Ben Waldie <ben@automatedworkflows.com>
-- http://www.automatedworkflows.com
-- Version 1.0.0 - Initial release
@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
@domenic
domenic / event-emitter.js
Last active March 11, 2022 15:25
Revealing constructor pattern event-emitter
// This event emitter emits events, but reserves the right to publish events to
// for its creator. It uses a WeakMap for true encapsulation.
const eesToEventMaps = new WeakMap();
export default class EventEmitter {
constructor(publisher) {
const eventMap = Object.create(null);
eesToEventMaps.set(this, eventMap);
@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
@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
@jrraymond
jrraymond / .jshintrc
Last active February 5, 2017 04:10
A starter JSHint jshintrc file with all options from the [JSHint Options Reference](http://www.jshint.com/docs/options/) list. Just copy into home/project folder and customize.
{
//Enforcing options
"bitwise" : true, // no bitwise operators
"camelcase" : true, // variable names camelCase or UPPER_CASE
"curly" : true, // curly braces around blocks
"eqeqeq" : true, // no == and !=
"es3" : false, // ECMAScript 3 specification
"forin" : true, // for in loops must filter object's items
"freeze" : false, // prevent overwriting native objects
"immed" : true, // immediate function invocations must be wrapped in ()
@jvns
jvns / interview-questions.md
Last active April 25, 2024 15:52
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@nnarhinen
nnarhinen / Gruntfile.js
Last active February 11, 2020 09:39
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@WebReflection
WebReflection / Delayed.js
Last active March 4, 2020 23:39
whenever you need to execute something after an interaction that might happen many times (panning, scrolling, etc) … this simple mechanism makes simple to execute that maybe expensive operations only once when things are "quiet" and never before or in the middle, if an action start as "start panning" would be is fired and it's calling the clear(…
/*jslint browser: true, indent: 2 */
var Delayed = (function (delay) {
/*! Andrea Giammarchi - Mit Style License */
// https://gist.github.com/WebReflection/7286687
'use strict';
// method shared across all delayed wrappers
function clear() {