Skip to content

Instantly share code, notes, and snippets.

View chrismadrigal's full-sized avatar

Chris Madrigal chrismadrigal

  • Grass Valley CA
View GitHub Profile
gem install sass
sass-convert -R ./ -F sass -T scss && rm *.sass or
sass-convert -R ./ -F sass -T scss && find . -type f -name '*.sass' -delete
@chrismadrigal
chrismadrigal / analytics.js
Created August 25, 2015 00:53
Override Segment's track method for setting default props on every track call
define(function (require) {
var _ = require('underscore');
// Override Segment's track method.
var _track = window.analytics.track;
window.analytics.track = function (event, properties, options, fn) {
// Arg shuffle.
if (_.isFunction(options)) fn = options, options = {};
if (_.isFunction(properties)) fn = properties, options = {}, properties = {};
@chrismadrigal
chrismadrigal / gist:be7e42c2f0691fea5237
Last active July 10, 2017 18:11
Browser testing in a VM on Mac

Microsoft provides free VM images for browser testing different IE/Windows combinations. To get started, follow the instructions to download the image or images. You can use these images alongside our existing VirtualBox setup.

Following their instructions, the basic process is to download all the parts of the VM image, set the main .sfx file as executable, and then running that file. You should see a new image become available in VirtualBox.

Modifying the hosts file

Once you have your Windows VM up and running, you'll need to edit the Windows hosts file so you can access the Creative Market development environment. (That's right. Your Mac is running Windows, and that Windows VM is communicating with a soft Linux box.)

The file should be located here:

@chrismadrigal
chrismadrigal / gist:c3c9b1761687fe76d66a
Last active August 29, 2015 14:14
Display Flex propertis
/*
* Container
*/
.container {
display: flex // or display:flex-inline
flex-direction: row | row-reverse | column | column-reverse;
}
.item {
@chrismadrigal
chrismadrigal / gist:21ec0dff9a61b9c25370
Last active August 29, 2015 14:08
Creative Market Deployment

##Deploying CSS and JS Changes.

  • Push changes to master branch
  • kitchen login
  • cd creativemarket.com
  • Run sudo grunt to complile css, minificarion, uglify, etc.
  • If sprites need to get build run sudo grunt sprites
  • sudo grunt deploy to deploy the changes live.
@chrismadrigal
chrismadrigal / killnode
Created October 17, 2014 20:18
killnode
#!/bin/bash
RCol='\033[0m' # Text Reset
Gre='\033[0;32m';
Yel='\033[0;33m';
Blu='\033[0;34m';
nodeprocess=$(ps aux | grep 'node ' | grep -v grep | grep -v peerlink-daemon | awk '{print $2}')
if [[ "$nodeprocess" != "" ]]; then
count=$(echo $nodeprocess | wc -w)
@chrismadrigal
chrismadrigal / gist:abc4ed8f83db27361740
Last active August 29, 2015 14:07
User.sublime-keymap
/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["n", "n"], "command": "advanced_new_file" }
]
@chrismadrigal
chrismadrigal / Preferences.sublim0e-settings
Created September 19, 2014 22:23
Sublime preferences defaults
{
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
[user]
name = Chris Madrigal
email = [email protected]
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
# Simple calculator
function calc() {
local result="";
result="$(printf "scale=10;$*\n" | bc --mathlib | tr -d '\\\n')";
# └─ default (when `--mathlib` is used) is 20
#
if [[ "$result" == *.* ]]; then
# improve the output for decimal numbers
printf "$result" |
sed -e 's/^\./0./' `# add "0" for cases like ".5"` \