Skip to content

Instantly share code, notes, and snippets.

View ntreadway's full-sized avatar

Nick Treadway ntreadway

  • Yeti Media
  • Orange County, Ca
  • X @nicktea
View GitHub Profile
@ntreadway
ntreadway / setup.md
Last active February 22, 2018 10:24 — forked from aaronromeo/setup.md
Setting up Protractor tests for Ionic on CodeShip

Under Test Settings

'Select your technology to prepopulate basic commands' as Node.js

Setup Commands

# By default we use the Node.js version set in your package.json or the latest
# version from the 0.10 release
#
# You can use nvm to install any Node.js (or io.js) version you require.
@ntreadway
ntreadway / gist:6ebe205c84685ba070e61f8608a7fac5
Created June 3, 2016 00:17 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@ntreadway
ntreadway / .swift
Created July 24, 2015 21:03
Unix timestamp to NSdate
for message in result.data.messages {
let json = JSON(message)
var date : NSDate!
if let messageDate = json["timetoken"].number {
let dateAsInt = messageDate as NSInteger!
let unixTime = dateAsInt / 10000000
date = NSDate(timeIntervalSince1970: NSTimeInterval(unixTime))
}
println("my date \(date)")
}
@ntreadway
ntreadway / Angular iOS style animation panel slider
Last active August 29, 2015 14:13
Angular iOS style animation
// Slide In From Right
// -------------------------------
@-webkit-keyframes slideInFromRight {
from { -webkit-transform: translate3d(100%, 0, 0); }
to { -webkit-transform: translate3d(0, 0, 0); }
}
@-moz-keyframes slideInFromRight {
from { -moz-transform: translateX(100%); }
to { -moz-transform: translateX(0); }
@ntreadway
ntreadway / gist:bf41ca89779e01ca748d
Created May 30, 2014 18:18
ion-content scrolling fix
<ion-conent>
<div class=“list”>
<!—content—>
</div>
</ion-content>
@ntreadway
ntreadway / _mixins.scss
Last active December 30, 2015 09:49
Hide and show Sass mixins for optimized device performance.
@mixin show-it {
height: auto;
visibility: visible;
@include opacity(1); // Compass mixin
}
@mixin hide-it {
position: absolute;
-webkit-transform: translate3d(-9999rem,0,0);
-moz-transform: translate3d(-9999rem,0,0);
@ntreadway
ntreadway / _mixins.scss
Created November 18, 2013 20:01
Sass mixins for mobile first development
// Mobile
@mixin kill-mobile-zoom {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: none;
}
@mixin kill-tap-highlight {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
@ntreadway
ntreadway / web.js
Created January 30, 2013 19:17
Express server for deploying to Heroku with Angular.
var express = require("express"),
app = express.createServer(express.logger());
port = process.env.PORT || 3000;
app.configure(function(){
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(express.static(__dirname + '/'));
app.use(express.errorHandler({
dumpExceptions: true,
source :rubygems
gem 'rake'
gem 'rack'
gem 'rack-rewrite'
gem 'thin'
gem 'sprockets', '2.2.0'
gem 'sass'
gem 'coffee-script'
@ntreadway
ntreadway / pagefailed.js.coffee.erb
Created April 27, 2012 22:46
Jquery page exception error for rails
<% if Rails.env.development? %>
@onLoadFailed = (event, data) ->
text = data.xhr.responseText
newHtml = text.split(/<\/?html[^>]*>/g)[1]
$("html").html newHtml
$(document).on "pageloadfailed", onLoadFailed
<% end %>