cd /path/
python -m SimpleHTTPServer 8000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h4>Web Hosting Bandwidth Calculator</h4> | |
<form> | |
<input id="avg_page_size" placeholder="Avg page size (MB)" type="text" /> | |
<br/> | |
<br/> | |
<input id="avg_daily_visitor" placeholder="Avg daily visitor" type="text" /> | |
<br/> | |
<br/> | |
<input id="avg_pages_per_visit" placeholder="Avg pages per visit" type="text" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demo: http://dontbodoh.com/result.php?char=character1.png <-- char paramater is dynamic based on result, return different image | |
// Check out line number 11 (image) and 14 (auto refresh) | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width; initial-scale=1; minimum-scale=1,maximum-scale=1.0; user-scalable=1;"> | |
<meta property="og:title" content="I have just checked if my mobile plan is the best in town through Don't Bodoh."> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ref { | |
display:none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install Anvil for Mac - http://anvilformac.com/ | |
2. Inside Anvil, install Pow (this will launch Terminal) | |
3. Go your machine System Preference > Network & copy your machine IP address (eg: 192.168.X.XXX) | |
4. Add a project using Anvil. Project URL will be something like this: project.dev | |
5. To access the project from other devices, type this URL format: [PROJECT].[IP_ADDRESS].xip.io | |
Example: | |
Anvil URL: helloworld.dev (only works in your local development machine) | |
Localhost URL: helloworld.192.168.X.XXX.xip.io (works on all devices on same network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install BrowserSync via NPM: | |
npm install -g browser-sync | |
2. Using Terminal, cd into project folder: | |
Example: cd/test | |
3. Add this kind of script inside HTML files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contacts = new Mongo.Collection('contacts'); | |
var checked = []; | |
if (Meteor.isClient) { | |
Template.contacts.helpers({ | |
contacts: function(){ | |
var filter = {sort: {}}; | |
var query = Session.get('query'); | |
filter.sort[Session.get('sortfilter')] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADD NEW IMAGE SIZE | |
add_action( 'after_setup_theme', 'baw_theme_setup' ); | |
function baw_theme_setup() { | |
add_image_size( 'full-post-width', 568 ); // 568 pixels wide (and unlimited height) | |
} | |
// REMOVE ALL IMAGE SIZES IN MEDIA UPLOADER WINDOW | |
function my_custom_image_sizes($sizes) { | |
unset( $sizes['thumbnail']); | |
unset( $sizes['medium']); |
So today I decided to explore how to use Paperclip + Amazon S3 on Heroku for photo upload process. The process is quite straight forward.
But, I got stucked after I deployed the Rails app into my Heroku account. I got this error:
We're sorry, but something went wrong
It took me hours to find out what's wrong. Finally, I found the solution.
Here's what I've done:
You can have finer control with:
rake db:drop:all
And then create the database without running the migrations:
rake db:create:all
Then run all your migrations: