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.
$ python -m SimpleHTTPServer 8000| /* Solarized Dark | |
| For use with Jekyll and Pygments | |
| http://ethanschoonover.com/solarized | |
| SOLARIZED HEX ROLE | |
| --------- -------- ------------------------------------------ | |
| base03 #002b36 background | |
| base01 #586e75 comments / secondary content |
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.
$ python -m SimpleHTTPServer 8000We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
| class Module | |
| # We often find ourselves with a medium-sized chunk of behavior that we'd | |
| # like to extract, but only mix in to a single class. | |
| # | |
| # We typically choose to leave the implementation directly in the class, | |
| # perhaps with a comment, because the mental and visual overhead of defining | |
| # a module, making it a Concern, and including it is just too great. | |
| # | |
| # | |
| # Using comments as lightweight modularity: |
| # modified https://gist.github.com/4147383 | |
| require 'uri' | |
| require 'cgi' | |
| require 'net/http' | |
| require 'openssl' | |
| def request(url, params = {}, klass = Net::HTTP::Get, pem_filecontent = nil) | |
| uri = uri.kind_of?(URI::Generic) ? url : URI.parse(url) | |
| if klass == Net::HTTP::Get && (!params.empty?) | |
| uri.query = [uri.query, URI.encode_www_form(params.stringify_keys)].reject(&:blank?).join('&') |
| license: gpl-3.0 |
| // ImagePreloadingViewController - An iOS view controller for trying out different | |
| // UIImage preloading strategies. Results for 1 MB png on iPhone 4S: | |
| // - No preload: drawing the image right away (80 ms) | |
| // - Header preload: getting the width (10 ms) and then drawing (100 ms) | |
| // - Data preload: getting the data (110 ms) and then drawing (75 ms) | |
| // - Draw preload: drawing it once (100 ms) and then again (20 ms) | |
| // In short: preload a UIImage by drawing it. | |
| // License: BSD | |
| // Author: Leonard van Driel, 2012 |
| # How to Install RVM, Ruby, and Gems without Xcode Command Line Tools | |
| # =================================================================== | |
| # | |
| # Mac OS X 10.8.2 (12C60) (Mountain Lion) | |
| # Xcode 4.5 (4G182) | |
| # | |
| # While attempting to `rvm pkg install openssl`, I had encountered the error: | |
| # > cryptlib.h:62:20: error: stdlib.h: No such file or directory | |
| # But, the commands & ouput below show how I worked around the issue. | |
| # |