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
-- ######################################################### | |
-- Author: www.sqlbook.com | |
-- Copyright: (c) www.sqlbook.com. You are free to use and redistribute | |
-- this script as long as this comments section with the | |
-- author and copyright details are not altered. | |
-- Purpose: For a specified user defined table (or all user defined | |
-- tables) in the database this script generates 4 Stored | |
-- Procedure definitions with different Procedure name | |
-- suffixes: | |
-- 1) List all records in the table (suffix of _GetAll) |
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
<?php | |
class HomepagePresenter extends BasePresenter | |
{ | |
public function actionDefault() | |
{ | |
$detector = $this->context->detector; | |
if ($detector->isMobile()) { | |
$this->redirect("mobile"); |
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
var cryptForm = function(formId, toCryptNames) { | |
document.getElementById(formId).onsubmit = function() { | |
var clonedForm = this.cloneNode(true); | |
var els = clonedForm.getElementsByTagName("input"); | |
for (i in els) if (toCryptNames.indexOf(els[i].name) > -1) | |
els[i].value = braintree.encrypt(els[i].value); | |
clonedForm.style.display = 'none'; | |
document.body.appendChild(clonedForm); |
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
#!/usr/bin/env ruby | |
# in the app's folder on your computer | |
# tube pull user@host:app_path [--from_env=production] [--to_env=development] | |
# | |
# e.g: | |
# tube pull host:apps/myapp | |
# tube pull user@host:/apps/myapp | |
require 'rubygems' |
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
var _isArray = function (obj) { | |
return obj && | |
typeof obj === 'object' && | |
typeof obj.length === 'number' && | |
typeof obj.splice === 'function' && | |
!(obj.propertyIsEnumerable('length')); | |
}; |
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
#!/bin/bash | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi | |
echo "What is the hostname of the server? " | |
read hostname |
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
#!/bin/bash | |
# install dependencies | |
apt-get install openssh-server curl git-core | |
apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev | |
# install RVM | |
bash < <(curl -sk https://rvm.beginrescueend.com/install/rvm) | |
### as per RVM instructions |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
deb http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse | |
deb-src http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse | |
deb http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted |