Skip to content

Instantly share code, notes, and snippets.

View rderoldan1's full-sized avatar
🇨🇴

Ruben Espinosa rderoldan1

🇨🇴
  • Medellin, Colombia
View GitHub Profile
@fotinakis
fotinakis / Dockerfile
Created November 23, 2014 20:48
Docker + fig with mounted volume for dev environment (and correctly handles bundle install).
# Base image.
FROM fotinakis/baseimage-ruby:2.1.3
# System dependencies for gems.
RUN apt-get update
RUN apt-get install -y --no-install-recommends libmysqlclient-dev
# Add 'web' user which will run the application.
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
@rusllonrails
rusllonrails / UBUNTU DOCKER FIG ERROR
Created August 14, 2014 12:16
UBUNTU DOCKER FIG ERROR
FIX FOR: Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
Change the DOCKER_OPTS in /etc/default/docker to:
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"
Ruslan Khamidullin [1:57 PM] netstat -ant |grep 4243
tcp 0 0 127.0.0.1:4243 0.0.0.0:* LISTEN
Ruslan Khamidullin [1:57 PM] export DOCKER_HOST=tcp://localhost:4243
@Joseph-N
Joseph-N / _message.html.erb
Last active April 15, 2021 11:09
Tutorial code snippets for chat application in rails. Tutorial link http://goo.gl/l3e8zN
<li class="<%= self_or_other(message) %>">
<div class="avatar">
<img src="http://placehold.it/50x50" />
</div>
<div class="chatboxmessagecontent">
<p><%= message.body %></p>
<time datetime="<%= message.created_at %>" title="<%= message.created_at.strftime("%d %b %Y at %I:%M%p") %>">
<%= message_interlocutor(message).name %> • <%= message.created_at.strftime("%H:%M %p") %>
</time>
</div>
/*
Swift Programming Language Guide
"A Swift Tour" Solutions
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1
These are the solutions to all the "experiments" in the pre-release Swift Programming Guide
(released on the same day Apple announced Swift). A couple of things worth noting:
1. Swift syntax, e.g. array declarations, has changed since I releasd these. So this code will
probably cause some errors when you paste it into a playground. Should be easy enough to fix
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

@rubencaro
rubencaro / gist:9545060
Last active May 7, 2020 20:59
Reversible encryption for url json data
require 'openssl'
require 'digest/sha1'
require 'base64'
require 'json'
def go_demo!
key = Digest::SHA1.hexdigest("clave1")[0..15] # 16bytes => 128bits
iv = 'clave2 con chicha'[0..15] # 16bytes forced
data = { esto: 'es', un: 'hash', en: 'ruby' }

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@mpapis
mpapis / take_n.rb
Last active January 2, 2016 04:28
ruby vs shell
puts "2.10.3".split(".")[0..1].join(".")
@rderoldan1
rderoldan1 / README.md
Created December 13, 2013 16:03
Ignore file changes in git

Fortunately GIT has a very easy solution for this, just run the following command on the file or path you want to ignore the changes of:

git update-index --assume-unchanged <file>

If you wanna start tracking changes again run the following command:

git update-index --no-assume-unchanged <file>

source: http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/