Skip to content

Instantly share code, notes, and snippets.

View thoughtpalette's full-sized avatar

Christopher Marshall thoughtpalette

View GitHub Profile
var $updatePasswordContainer = $( ".update-password" ),
$savePasswordBtn = $( ".save-password" );
$cancelEditBtn = $( ".cancel-password" );
var updatePasswordSection = {
toggle: function( parentEl, initialValue )
{
if ( $updatePasswordContainer.hasClass( "editing" ) )
{
@thoughtpalette
thoughtpalette / Ionic Favorites Chapter
Created March 6, 2015 15:17
Ionic Favorites Chapter
## Setting up the Favorites view
In the previous chapter, you learned how to set up the application routes, define a state and link your state to your custom template and controller. We will be utilizing all of those constructs in this chapter in setting up the Favorites view.
The Favorites view will allow the user to add and save a location that will be used to find nearby Instagram posts.
We will be using the following modules and Ionic Plugins in this chapter:
1. HTML5 Local Storage (angular-local-storage)
2. Ionic Modal
@thoughtpalette
thoughtpalette / emoji-list.json
Created November 4, 2014 22:30
emoji list ment.io support
// http://jeff-collins.github.io/ment.io/#/
var emojis = [
{ "label" : "bowtie" },
{ "label" : "smile" },
{ "label" : "laughing" },
{ "label" : "blush" },
{ "label" : "smiley" },
{ "label" : "relaxed" },
{ "label" : "smirk" },
@thoughtpalette
thoughtpalette / Infinite Scroll Markup
Last active December 6, 2016 12:12
ngInfiniteScroll Service
<table>
<thead>
<th>ID</th>
<th>Title</th>
<th>Creator Email</th>
<th># of Users</th>
<th># of Photos</th>
<th>Privacy Type</th>
<th>View Images</th>
</thead>
@thoughtpalette
thoughtpalette / startup-video-notes
Last active August 29, 2015 14:06
Notes on how to start a startup video.
Video: [How to start a startup](https://www.youtube.com/watch?v=CBYhVcO4WgI)
Notes by: [philipDS](https://news.ycombinator.com/user?id=philipDS)
# 4 critical parts: Idea, Team, Product, Execution
## 1. Idea
-> Good startups take about 10 years
-> Startup should feel like an important mission
@thoughtpalette
thoughtpalette / state-select-directive
Created September 16, 2014 22:23
AngularJS State Select Menu Directive.
dirMod.directive( "stateselectmenu", function ()
{
return {
restrict: "A",
template: "<option value='AL'>Alabama</option><option value='AK'>Alaska</option><option value='AZ'>Arizona</option><option value='AR'>Arkansas</option> <option value='CA'>California</option> <option value='CO'>Colorado</option> <option value='CT'>Connecticut</option> <option value='DE'>Delaware</option> <option value='DC'>District Of Columbia</option> <option value='FL'>Florida</option> <option value='GA'>Georgia</option> <option value='HI'>Hawaii</option> <option value='ID'>Idaho</option> <option value='IL'>Illinois</option> <option value='IN'>Indiana</option> <option value='IA'>Iowa</option> <option value='KS'>Kansas</option> <option value='KY'>Kentucky</option> <option value='LA'>Louisiana</option> <option value='ME'>Maine</option> <option value='MD'>Maryland</option> <option value='MA'>Massachusetts</option> <option value='MI'>Michigan</option> <option value='MN'>Minnesota</option> <option value='MS'>Mississippi</option> <
@thoughtpalette
thoughtpalette / twilio-post
Created August 6, 2014 20:19
Twilio API jQuery Post
// Had issues with CORS when implementing different post types and changing headers in node/express/angular.$http, this works even though it still gives me the CORS error.
$.ajax({
type: "POST",
username: "[ACCOUNT_SID]",
password: "[AUTH_TOKEN]",
url: "https://api.twilio.com/2010-04-01/Accounts/[SID_HERE]/SMS/Messages",
xhrFields: {
withCredentials: true
},
@thoughtpalette
thoughtpalette / Gruntfile.js
Last active August 29, 2015 14:04
Default Gruntfile
module.exports = function( grunt )
{
// Project configuration
grunt.initConfig( {
pkg: grunt.file.readJSON( "package.json" ),
watch:
{
livereload: {
options: {livereload: true},
files: ['source/**/*']
@thoughtpalette
thoughtpalette / tracking
Last active August 29, 2015 13:57
GA Click Tracking, Scroll Tracking and YouTube Video (play/complete) tracking for Single and Multiple Videos
var asyncYouTubeApiLoad = function() {
//https://developers.google.com/youtube/iframe_api_reference
// This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
};
var initiateVideoTracking = function() {
@thoughtpalette
thoughtpalette / Smooth Mobile Animation Fixes
Created January 10, 2014 19:28
Mobile CSS Awesomeness
/* Fix overflow scrolling wonkiness */
-webkit-overflow-scrolling: touch;
.list-first-level,
.list-second-level,
.list-third-level {
-o-transition: .3s linear;
-ms-transition: .3s linear;
-moz-transition: .3s linear;