- Create a
~/Sitesfolder if you don’t already have one - Enable PHP by uncommenting the
php5_moduleline in/etc/apache2/httpd.conf - Find the line that read
User _wwwand change the_wwwto your username (whoami) - Find the
DirectoryIndexline and change it toDirectoryIndex index.php index.html index.htm - Change the
DocumentRootline toDocumentRoot "/Users/yourusername/Sites/" - Change the
<Directoryline to<Directory "/Users/yourusername/Sites/"> - Run
sudo apachectl restart - Restart your computer (yes, this is necessary)
This file contains hidden or 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
| biggie = Notorious.new("BIG") | |
| you = Person.new(self) | |
| var it = "all a dream" | |
| biggie.read("Word Up Magazine") | |
| limosine = ["Salt & Pepper", "Heavy D"] | |
| wall.hang("pictures") | |
| if ((new Date).toString().substr(0,3) == "Sat") { | |
| var rap_attack = Array.new | |
| rap_attack.push("Mr. Magic", "Marley Marl") |
This file contains hidden or 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
| # Because sometimes curses are not enough. | |
| request = require 'request' | |
| module.exports = (robot) -> | |
| robot.respond /release the shakespearian insults/i, (msg) -> | |
| request uri: 'http://www.pangloss.com/seidel/Shaker/index.html', (err, res, body) -> | |
| msg.send body.match(/<font size="\+2">\s(.*)<\/font>/)[1].replace(/<br>/, " ") |
This file contains hidden or 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
| # This is the easiest way to generate a csv and have it downloaded by the user. | |
| # Drop this in a method in the controller and call it on click. | |
| require 'csv' | |
| file = CSV.generate do |csv| | |
| csv << ["Name", "Email"] # headers | |
| Contact.all.each do |person| | |
| csv << [person.name, person.email] | |
| end |
This file contains hidden or 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
| # This script runs through all the png images in a passed folder and sprites them | |
| require 'fileutils' | |
| puts "processing files..." | |
| files = [] | |
| Dir["#{ARGV.first}/*.png"].each do |f| | |
| files << f | |
| end |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Flexible UI With SASS</title> | |
| <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400' rel='stylesheet'> | |
| <link rel='stylesheet' href='master.css' /> | |
| </head> | |
| <body> | |
| <h1>Flexible UI With SASS</h1> | |
| <div class='container'> |
This file contains hidden or 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
| # error handling | |
| # -------------- | |
| compiler.on 'error', -> | |
| utils.add_error_messages() | |
| this.finish() | |
| compiler.one 'finished', -> | |
| console.log 'compilation done' |
This file contains hidden or 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
| $('.switch').on('click', function(){ | |
| var modes = ['night', 'day']; | |
| var current = this.hasClass('on') ? 0 : 1; | |
| $('link[href=' + modes[current] + '.css').attr('href', + modes[~~current] + '.css'); | |
| this.toggleClass('on'); | |
| }) |
This file contains hidden or 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
| # path: | |
| PS1='\[\e[0;33m\]⚡\[\e[m\] \[\e[0;31m\]${PWD##*/}\[\e[m\] ' | |
| # general shorcuts | |
| alias ll="ls -lahG" | |
| alias reload="source ~/.profile" | |
| alias up="cd .." | |
| alias back="cd -" | |
| alias desktop="cd ~/Desktop" | |
| alias server="python -m SimpleHTTPServer" |
This file contains hidden or 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
| $(function(){ | |
| var element = $('#boxes li').first(); | |
| element.toggleClass('selected'); | |
| console.log(element); | |
| }); |