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
| # Url Class | |
| class @Url | |
| constructor: (@path) -> | |
| getQueryValue: (key) -> | |
| try | |
| queries = @getAllQueries() | |
| i = 0 | |
| if queries && queries.length > 0 |
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
| # Time Class | |
| class @Time | |
| constructor: (@seconds) -> | |
| getElapsedTimeString: (seconds) -> | |
| currentTimeString = "00:00:00" | |
| try | |
| hours = Math.floor(seconds / 3600) | |
| seconds = seconds % 3600 |
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
| class CallsController < ApplicationController | |
| include ApplicationHelper | |
| include CallsHelper | |
| before_filter :setup_lists | |
| before_filter :set_sources | |
| def index | |
| now = Date.today |
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
| # type the following commands in terminal on your local machine | |
| # to copy something from this system to some other system: | |
| scp /path/to/local/file username@hostname:/path/to/remote/file | |
| # to copy something from some system to some other system: | |
| scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file | |
| # to copy something from another system to this system: | |
| scp username@hostname:/path/to/remote/file /path/to/local/file |
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 | |
| ### MySQL Server Login Info ### | |
| MUSER="root" | |
| MPASS="root_password" | |
| MHOST="localhost" | |
| MYSQL="$(which mysql)" | |
| MYSQLDUMP="$(which mysqldump)" | |
| BAK="/path/to/export" | |
| # USE THIS CODE TO BACKUP ONLY ONE SPECIFIC DB |
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
| Source : https://github.com/augustl/net-http-cheat-sheet | |
| ######################## | |
| #Standard HTTP Request | |
| ####################### | |
| require "net/http" | |
| require "uri" | |
| uri = URI.parse("http://google.com/") |
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 bash | |
| if aptitude search '~i ^curl$' | grep -q curl; then | |
| apt-get -y install curl git-core python-software-properties | |
| fi |
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 bash | |
| if aptitude search '~i ^nginx$' | grep -q nginx; then | |
| echo "nginx already installed, skipping." | |
| else | |
| aptitude -y install nginx | |
| service nginx start | |
| fi |
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 bash | |
| # deployer is the admin user | |
| # replace the x by your own server IP | |
| cat ~/.ssh/id_rsa.pub | ssh [email protected] 'cat >> ~/.ssh/authorized_keys' |
OlderNewer