Skip to content

Instantly share code, notes, and snippets.

View xiy's full-sized avatar
deploying

Mark Anthony Gibbins xiy

deploying
View GitHub Profile

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@xiy
xiy / README.md
Created May 30, 2012 01:53
Install Nginx+Unicorn on Red Hat OpenShift

Installing Nginx+Unicorn on Red Hat OpenShift

This set of scripts and config files will help you set up the awesome combination of Unicorn and Nginx as a server environment for Ruby web applications on Red Hat's OpenShift platform while I finish my cartridge.

Notes

  • Before you get started, you should read my post on how to set up Ruby 1.9 environment on OpenShift here: http://goo.gl/ufI5G This will (hopefully) get you started on building a Rails app on OpenShift the unofficial way (for now!).
@xiy
xiy / andromeda.tmTheme
Created January 25, 2013 00:20
SPACE CODE.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Andromeda</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@xiy
xiy / gist:5922482
Last active December 19, 2015 07:59
#define the empty variable text
text =''
#define the line_count variable as 0.
line_count = 0
#open the text file I am working with, and use the each method to iterate
#each line and place it into the variable 'line'
File.open("text.txt").each do |line|
#add 1 for each line during each iterated line. (Loop until each line is processed?)
@xiy
xiy / rbenv.fish
Created December 19, 2013 10:35
rbenv functions for the fish shell, by Łukasz Niemier: https://coderwall.com/p/6hja1w
function rbenv_shell
set -l vers $argv[1]
switch "$vers"
case '--complete'
echo '--unset'
echo 'system'
command rbenv versions --bare
return
case '--unset'
@xiy
xiy / rails-4-concern.sublime-snippet
Created June 16, 2014 19:29
A sublime text editor snippet to quickly create a new Rails Concern
<snippet>
<content><![CDATA[module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}}
extend ActiveSupport::Concern
included do
$2
end
end]]></content>
<tabTrigger>mod</tabTrigger>
<scope>source.ruby, source.ruby.rails, source.rails</scope>
@xiy
xiy / deep_struct.rb
Last active May 11, 2016 10:36 — forked from brodock/deep_struct.rb
Hash to Struct
require 'ostruct'
class DeepStruct < OpenStruct
def initialize(hash = {})
@table = {}
@hash_table = {}
hash.each do |k, v|
recrusively_initialize(v) if v.is_a?(Array)
@xiy
xiy / button.js
Last active June 7, 2016 16:39
The crappy button
import React, { Component } from 'react';
import {
TouchableOpacity,
StyleSheet,
Text
} from 'react-native';
@xiy
xiy / button.js
Last active June 7, 2016 16:40
The crappy button - Part 2
import React, { Component } from 'react';
import {
TouchableOpacity,
StyleSheet,
Text
} from 'react-native';
export default class Button extends React.Component {
constructor(props) {