Skip to content

Instantly share code, notes, and snippets.

@cmalven
cmalven / programming_elixir_notes.ex
Created June 25, 2016 13:28
Programming Elixir Notes
# Programming Elixir
## Value Types
# Integers
6
1_000_000
# Floating Point
//
// ECMAScript 6 Cheat Sheet
//
//////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------
// Arrows (and this)
//---------------------------------------------------------------
@cmalven
cmalven / check_user_camera.js
Created September 10, 2015 18:27
Check for availability of User Camera
if (Modernizr.getUserMedia || Modernizr.flash ) {
// The user has either getUserMedia or Flash available, so we can show the button.
$('.js-use-webcam-btn').show();
}
@cmalven
cmalven / install_php_mongo_mamp_os_x.md
Created August 7, 2015 15:07
Installing Mongo PHP extension for MAMP on Mac OS X

Open your .bashrc or .zshrc file and add:

# Mamp PHP Path
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH

The version number here should correspond to the version you're using in MAMP.

Next, open /Applications/MAMP/bin/php/php5.6.10 and add a folder called include and within that a folder called php

@cmalven
cmalven / SassMeister-input.scss
Created February 11, 2015 17:22
Generated by SassMeister.com.
// ----
// libsass (v3.1.0-beta)
// ----
$base-colors: (
red: #ea1c2c,
drkred: #5b0411,
ltred: #e28a91,
blue: #2daae1,
drkblue: #2596c7,
@cmalven
cmalven / SassMeister-input.scss
Created February 11, 2015 17:17
Generated by SassMeister.com.
// ----
// libsass (v3.1.0-beta)
// ----
$base-colors: (
red: #ea1c2c,
drkred: #5b0411,
ltred: #e28a91,
blue: #2daae1,
drkblue: #2596c7,
@cmalven
cmalven / gulpfile.js
Last active August 29, 2015 14:14
Faking Sass Globbing
// ...
gulp.task('concatStyles', function() {
return gulp.src(['assets/styles/objects/**/*.scss', 'assets/styles/layout/**/*.scss'])
.pipe(concat)
.pipe(gulp.dest('/'))
.pipe(concat('_combined-object-layout.scss'));
});
gulp.task('styles', ['concatStyles'], function() {
@cmalven
cmalven / notes-7-min-with-react.js
Created February 6, 2015 19:50
Notes on "7 Minutes with React"
// React JS Notes
// All of the following uses JSX compiling, without JSX the HTML-style syntax isn't possible.
// See this as a reference: http://jsbin.com/falicahequ/1/edit?html,js,output
// The basic unit of React is a "component", created like so...
var React = require('react');
var Component = React.createClass({
render: function() {
@cmalven
cmalven / index.js
Last active August 29, 2015 14:13
requirebin sketch
var Collection = require('ampersand-collection');
var SubCollection = require('ampersand-subcollection');
var Model = require('ampersand-model');
var MyModel = Model.extend({
props: {
name: 'string',
selected: 'boolean'
}
});
@cmalven
cmalven / cheatsheet-layout-rendering-rails.md
Last active October 3, 2018 19:07
Cheat Sheet: Layouts and Rendering in Rails