Skip to content

Instantly share code, notes, and snippets.

Julian Ponce jponc

Block or report user

Report or block jponc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docker-machine-mac-osx.md

VirtualBox

  • https://www.docker.com/toolbox
  • docker-machine create --driver virtualbox dev
  • docker-machine env dev (add values to ~/.zshrc)
    • e.g. echo eval "$(docker-machine env dev)" >> ~/.zshrc
  • docker-machine ls
  • docker ps (might need to re-source .zshrc file; e.g. . ~/.zshrc)
  • docker run hello-world
  • docker-machine ip dev
@jponc
jponc / index.js
Created Jul 22, 2017
Can't identify userLogin action :(
View index.js
import React, { Component } from 'react'
import { Field, reduxForm } from 'redux-form'
import { userLogin } from '../../actions'
import './index.css'
class Login extends Component {
componentWillMount (){
document.body.classList.add('login');
@jponc
jponc / .tmux.conf
Created Mar 30, 2016
Personal Tmux Conf
View .tmux.conf
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
@jponc
jponc / service_object_example.rb
Last active Dec 28, 2015
Service Object Example
View service_object_example.rb
class Invoice
def process_payment
# In this manner, it abstracts the logic of payment processing to the service object
InvoiceServices::Payment.new(self).process
end
end
class Tracker
def self.track
# Do tracking stuff here
@jponc
jponc / schema.xml
Created Jul 29, 2015
Solr configuration
View schema.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@jponc
jponc / active_record_mongoid_bridge.rb
Created May 18, 2015
Creating basic association between ActiveRecord models and Mongoid documents
View active_record_mongoid_bridge.rb
# Original source: http://hashrocket.com/blog/posts/bridging-activerecord-and-mongoid
class ActiveRecord::Base
def self.has_many_documents(association_name)
class_eval %<
def #{association_name}
#{association_name.to_s.singularize.classify}.where(#{name.underscore}_id: id)
end
>
end
@jponc
jponc / blackjack.c
Created Nov 4, 2014
BlackJack Game for my youngest brother lol
View blackjack.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SUIT_MAX_VAL 4
#define NUM_MAX_VAL 13
#define BLACK_JACK_NUM 21
char deck[4][13];
@jponc
jponc / gist:329d0b28dd187ac783e2
Created Oct 2, 2014
Rubocop sublime settings rbenv
View gist:329d0b28dd187ac783e2
{
// Here you can provide your own command line
// which is used to run rubocop. The path will be
// replaced by the file or folder which needs
// to be checked.
//
// If check_for_rvm or check_for_rbenv is enabled,
// it will be prefixed with a call to rvm or rbenv.
// If none of them are enabled, the command will be
// executed without any additions.
View gist:019865631ccced263b27
{
"erb_verify_command": "erb -xT - {file_name} | ruby -c",
"ruby_verify_command": "ruby -c {file_name}",
"run_ruby_unit_command": "ruby -Itest {relative_path}",
"run_single_ruby_unit_command": "ruby -Itest {relative_path} -n '{test_name}'",
"run_cucumber_command": "zeus cucumber {relative_path} --no-color",
"run_single_cucumber_command": "zeus cucumber {relative_path}:{line_number} --no-color",
You can’t perform that action at this time.