Skip to content

Instantly share code, notes, and snippets.

# Create the XHR object.
createCORSRequest = (method, url) ->
xhr = new XMLHttpRequest
if 'withCredentials' of xhr
# XHR for Chrome/Firefox/Opera/Safari.
xhr.open method, url, true
else if typeof XDomainRequest != 'undefined'
# XDomainRequest for IE.
xhr = new XDomainRequest
xhr.open method, url
@Wallsays
Wallsays / bootstrap.sh
Created January 20, 2014 12:39
Bootstrap Ruby & Chef Solo for Ubuntu 12.04 LTS 64 bit
#!/usr/bin/env bash
apt-get -y update
# Install dependencies
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl
# Install Ruby 1.9.3 from source
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
[root@www ~]# yum -y install mysql-server
[root@www ~]# systemctl start mysqld.service
[root@www ~]# systemctl enable mysqld.service
ln -s '/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'
[root@www ~]# mysql -u root # connect to MySQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text %U
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Development;IDE;Utility;TextEditor;"
@Wallsays
Wallsays / sublime-text-3-installation.txt
Last active December 20, 2015 02:09
Install Sublime Text 3 on fedora 17/18/19
1) Remove Sublime Text 2
sudo yum -y remove sublime-text
2) Install Sublime text 3
1. sudo yum install wget
2. wget http://commondatastorage.googleapis.com/xenodecdn%2Fsublime3sh.tar.gz -O sublime3sh.tar.gz
3. tar -xvf sublime3sh.tar.gz
@Wallsays
Wallsays / Preferences.sublime-setings
Last active December 20, 2015 01:29
User settings Sublime Text for Ruby
{
"color_scheme": "Packages/User/Railscast2.tmTheme",
"font_size": 10,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"save_on_focus_lost": true,
"hot_exit": false
}