Skip to content

Instantly share code, notes, and snippets.

@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@deepakprasanna
deepakprasanna / doc_pdf_crawler.rb
Created June 14, 2011 09:42
Jruby script which parses the PDF/doc/docx files.
JARS_PATH = File.join(RAILS_ROOT, "lib/jars")
Dir["#{JARS_PATH}/*jar"].each {|j| require j} #Suck the jars.
require "java"
import org.apache.pdfbox.pdfparser.PDFParser
import org.apache.pdfbox.pdmodel.PDDocument
import org.apache.pdfbox.util.PDFTextStripper
import org.apache.poi.extractor.ExtractorFactory
#importing all the required classes.
@slyphon
slyphon / ruby1line.txt
Created November 23, 2011 16:11
ruby one-liners (saving here for posterity) from http://www.fepus.net/ruby1line.txt
HANDY ONE-LINERS FOR RUBY November 16, 2005
compiled by David P Thomas <davidpthomas@gmail.com> version 1.0
Latest version of this file can be found at:
http://www.fepus.net/ruby1line.txt
Last Updated: Wed Nov 16 08:35:02 CST 2005
FILE SPACING:
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@donpdonp
donpdonp / gist:2258175
Created March 31, 2012 00:28
sublime text 2 Slim
donp@sparky:~/.config/sublime-text-2/Packages$ git clone git://github.com/fredwu/ruby-slim-tmbundle.git Ruby-Slim.tmbundle
Cloning into Ruby-Slim.tmbundle...
remote: Counting objects: 142, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 142 (delta 89), reused 114 (delta 61)
Receiving objects: 100% (142/142), 21.44 KiB, done.
Resolving deltas: 100% (89/89), done.
donp@sparky:~/.config/sublime-text-2/Packages$ ls Ruby-Slim.tmbundle/
Commands info.plist Preferences README.md Snippets Syntaxes
donp@sparky:~/.config/sublime-text-2/Packages$
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

class Application < Sinatra::Base
configure do
enable :static
set :views, File.join(File.dirname(__FILE__), 'views')
end
get '/' do
slim :index
end
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ematta
ematta / ags-install
Last active January 1, 2016 22:39
How to install AGS on Fedora
# Install AGS in Fedora 20
# https://github.com/adventuregamestudio/ags/blob/master/debian/README.md
# Change this to whatever you use for home dir apps
cd ~/app
git clone git://github.com/adventuregamestudio/ags.git
cd ags
sudo yum -y install python-devel freetype-devel libvorbis-devel allegro-devel allegro libtheora libtheora-devel dumb-devel dumb
make --directory=Engine
sudo make --directory=Engine install