git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| /** | |
| * jQuery.deparam - The oposite of jQuery param. Creates an object of query string parameters. | |
| * | |
| * Credits for the idea and Regex: | |
| * http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/ | |
| */ | |
| (function($){ | |
| $.deparam = $.deparam || function(uri){ | |
| if(uri === undefined){ | |
| uri = window.location.search; |
| <?php | |
| $params = new stdClass; | |
| $params->hpci_site_host_name = baseurl(); | |
| $params->hpci_site_id = '520900'; | |
| $params->hpci_location = 'checkout1'; | |
| $params->hpci_query_string = $_SERVER['QUERY_STRING']; | |
| $params->hpci_api_host = 'https://api-wisvis1stg.c1.hostedpci.com/'; | |
| $params->hpci_api_uid = 'ObtainTestAccount'; | |
| $params->hpci_api_pwd = '*****'; | |
| ?> |
| <?php | |
| class SecureSessionHandler extends SessionHandler { | |
| protected $key, $name, $cookie; | |
| public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
| { | |
| $this->key = $key; | |
| $this->name = $name; |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| <?php | |
| $db_con = mysqli_connect("localhost", "username", "password", "database"); | |
| $result = $db_con->query('SELECT * FROM some_table'); | |
| if (!$result) die('Couldn\'t fetch records'); | |
| $num_fields = mysqli_num_fields($result); | |
| $headers = array(); | |
| while ($fieldinfo = mysqli_fetch_field($result)) { | |
| $headers[] = $fieldinfo->name; | |
| } | |
| $fp = fopen('php://output', 'w'); |
| #!/bin/bash | |
| # Disclaimer - make backups, use at your own risk. | |
| # | |
| # Based on this comment: http://stackoverflow.com/a/13944924/843067 | |
| # Views and stored procedures have to be done separately. | |
| OLDDB="old_db_name" | |
| NEWDB="new_db_name" | |
| MYSQL="mysql -u root -pyour_password " |
| <!-- HTML heavily inspired by http://blueimp.github.io/jQuery-File-Upload/ --> | |
| <div class="table table-striped" class="files" id="previews"> | |
| <div id="template" class="file-row"> | |
| <!-- This is used as the file preview template --> | |
| <div> | |
| <span class="preview"><img data-dz-thumbnail /></span> | |
| </div> | |
| <div> | |
| <p class="name" data-dz-name></p> |
| // Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument | |
| var previewNode = document.querySelector("#template"); | |
| previewNode.id = ""; | |
| var previewTemplate = previewNode.parentNode.innerHTML; | |
| previewNode.parentNode.removeChild(previewNode); | |
| var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone | |
| url: "/target-url", // Set the url | |
| thumbnailWidth: 80, | |
| thumbnailHeight: 80, |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545