Skip to content

Instantly share code, notes, and snippets.

View Ashley-Upson's full-sized avatar

Ashley Upson Ashley-Upson

View GitHub Profile
$fileName = 'Billing-Summary.csv';
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename={$fileName}");
header("Expires: 0");
header("Pragma: public");
$fh = @fopen( 'php://output', 'w' );
@Ashley-Upson
Ashley-Upson / help.html
Created November 26, 2017 08:07
Facebook help - splitting a value into an array.
<script type="text/javascript">
var dates = document.getElementById("dates_input").value,
dates_split = dates.split(" - "),
start_date = dates_split[0],
end_date = dates_split[1];
console.log("First date: " + start_date);
console.log("Second date: " + end_date);
</script>
<?php
// Define the connection variables.
$dbHost = "localhost";
$dbUser = "root";
$dbPass = "";
$dbName = null;
// Connect to the database.
$conn = new mysqli($dbHost, $dbUser, $dbPass);
scraper = {
lastRowShown: 0,
lastRowInSet: 0,
results: [],
complete: false,
prev: 1,
run: function()
{
console.log("Initialising");
var countInfo = $("#all_organizations_info").text();
#include<iostream>
#include<iomanip>
using namespace std;
const int size = 3;
bool isGameOver = false;
int player = 1;
char player1 = 'X';
char player2 = 'O';
int input = 0;
int win = 0;
#include<iostream>
#include<iomanip>
using namespace std;
const int size = 3;
bool isGameOver = false;
char player1 = 'X';
char player2 = 'O';
int input = 0;
int win = 0;
int n;
<?php
error_reporting(0);
session_start();
function connect() {
$db = new mysqli("host", "user", "pass", "db");
if($db -> connect_error) {
die("Couldn't connect to the database: " . $db -> connect_error);
}
return $db;
}
/* Globals */
a, a:link, a:visited {
color: #cecece;
}
a:hover {
color: #ffffff;
font-weight: bold;
text-decoration: underline;