Skip to content

Instantly share code, notes, and snippets.

View rimian's full-sized avatar

Rimian Perkins rimian

View GitHub Profile
@rimian
rimian / style-guides.md
Last active February 3, 2018 03:29
Style Guides

Using an Open Source Style Guide

These are some of the style guides I have researched. These may enable a small company to have a cost effective style guide by borrowing from something already created. By forking one of these repositories and adapting it something, something, blaa, blaa nobody reads this anyway. Just look at the links below.

MIT license

@rimian
rimian / CordovaBuild.md
Last active November 21, 2017 00:40
Cordova Build

Cordova uses config.xml to manage plugins but doesn't validate itself on a build. So you need to clean out the browser and plugin files if there are changes.

  • cd cordova
  • rm -rf plugins/* platforms/*
  • cordova build
@rimian
rimian / cordova-ubuntu.md
Last active October 21, 2017 01:19
Notes on upgrading cordova for Ununtu

I previously documented that we should ignore changes to the cordova/config.xml file. This is incorrect. Run this in root:

git update-index --no-assume-unchanged cordova/config.xml

Cordova 7.0.1 had a bug in it. This has been resolved in 7.1.0. The emulator runs on Ubuntu now.

Check which version on cordova: cordova -v. If your version is less than 7.1, remove the corodova app directly and reinstall it with npm. Cordova is installed here: which cordova. Then run sudo npm imnstall -g corodva

I've told git to ingore all cordova plugin and platform files. You'll need to add these manually. Because they were in our repo, You'll need to clean out these directories rm -rf cordova/plugins/* cordova/platforms/*

@rimian
rimian / controllers.application.js
Last active October 4, 2017 23:20
Ordered Has Many
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Has Many Sort',
});
@rimian
rimian / controllers.application.js
Last active August 10, 2017 00:22
many to many
import Ember from 'ember';
import DS from 'ember-data';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
let store = this.get('store');
let blogPost = store.createRecord('blogPost', {
id: 1,
@rimian
rimian / gist:3c0d774256d405c012845362b0c8bfed
Last active March 7, 2017 22:54
Gravity Form deny download
<IfModule mod_rewrite.c>
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
@rimian
rimian / mount-engine.sh
Last active November 3, 2016 00:41
Mounting an engine into Discourse.
echo "gem 'memberful', :git => 'https://github.com/choiceaustralia/memberful-integration.git'" >> Gemfile
su discourse -c 'bundle install --no-deployment --verbose --without test --without development --path vendor/bundle'
echo "require 'memberful'" >> config/application.rb
echo "Discourse::Application.routes.draw { mount Memberful::Engine, :at => '/memberful' }" >> config/routes.rb
% if ($session{'CurrentUser'}->EmailAddress =~ /\@example\.net$/) {
<script type="text/javascript"
% if ( $ENV{'SERVER_NAME'} =~ /integration/ ) {
src="http://bam.integration.example.net/bam.js"
% } else {
src="https://bam.production.example.net/bam.js"
% }
></script>
@rimian
rimian / gulpfile
Created April 20, 2015 10:53
My Gulp File Yo
var
concat = require('gulp-concat'),
del = require('del'),
gulp = require('gulp'),
karma = require('gulp-karma'),
args = require('yargs');
var Args = function(yargs) {
var _match = yargs.m || yargs.match;
var _file = yargs.f || yargs.file;
#!/usr/bin/perl -w
use strict;
# sets mtime and atime of files to the latest commit time in git
#
# This is useful for serving static content (managed by git)
# from a cluster of identically configured HTTP servers. HTTP
# clients and content delivery networks can get consistent
# Last-Modified headers no matter which HTTP server in the
# cluster they hit. This should improve caching behavior.