Skip to content

Instantly share code, notes, and snippets.

Avatar

Deivinson Tejeda deivinsontejeda

View GitHub Profile
@thelibrarian
thelibrarian / Fixing XCode Command Line Tools.md
Last active Nov 6, 2017
How to fix compile errors with the XCode command line tools on Mac OS X. Solves problems such as failing to find Framework header files (e.g. ruby.h).
View Fixing XCode Command Line Tools.md

The Problem

If you have installed the standalone Command Line Tools for XCode on your Mac (i.e. without having XCode.app installed), some of these tools can get a bit confused due to a couple of oversights on Apple's part in finalising the setup.

Note: all commands below will need to be run from an Administrator account, or by an account with appropriate permission in /etc/sudoers.

The Solution

1. Failing to Find Frameworks

Sometime when compiling against the preinstalled Frameworks (e.g. Ruby or Python), various tools will inexplicable fail to find header files that are quite clearly there. This is caused by the fact that no XCode has been selected for the command-line tools. Wait, I hear you cry, I don't have XCode installed! Indeed, but you nonetheless need to select one, and point it somewhere where the command line tools exist, like so

@shu0115
shu0115 / file0.txt
Created Feb 25, 2013
Ruby 2.0.0-p0インストール(Mac OS X 10.8.2) ref: http://qiita.com/items/a24d1c8a1539f858137b
View file0.txt
brew uninstall openssl
brew uninstall curl-ca-bundle
brew uninstall readline
@bf4
bf4 / ruby_learning.md
Last active Dec 11, 2015
Some Ruby Learning Resources
View ruby_learning.md
View gist:3672976
var client = bayeux.getClient()
, channelKeyPrefix = "room:";
bayeux.bind('subscribe', function(clientId, channel){
redisClient.incr(channelKeyPrefix + channel, function(error, value){
client.publish(channel, {
event: 'user-change',
params: {
onlineUsers: value
}
@rweald
rweald / simple-linear-regression.rb
Created Aug 29, 2012
Simple Linear Regression in Ruby
View simple-linear-regression.rb
class SimpleLinearRegression
def initialize(xs, ys)
@xs, @ys = xs, ys
if @xs.length != @ys.length
raise "Unbalanced data. xs need to be same length as ys"
end
end
def y_intercept
mean(@ys) - (slope * mean(@xs))
@maccman
maccman / juggernaut.rb
Created Jun 26, 2012
Sinatra Server Side Event streaming.
View juggernaut.rb
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@coreyhaines
coreyhaines / .rspec
Last active Apr 17, 2021
Active Record Spec Helper - Loading just active record
View .rspec
--colour
-I app
anonymous
anonymous / hammer
Created Mar 1, 2012
hammer prototype
View hammer
#!/usr/bin/env ruby
# -*- encoding: UTF-8 -*-
# Derived from <http://stackoverflow.com/questions/5663519/namespacing-thor-commands-in-a-standalone-ruby-executable>
require 'rubygems'
require 'thor'
require 'thor/group'
module Hammer
@franck
franck / monitrc
Created Dec 1, 2011
monit config file (nginx, mysql, redis, tomcat)
View monitrc
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.