Skip to content

Instantly share code, notes, and snippets.

View adamtester's full-sized avatar
💻
Coding

Adam Tester adamtester

💻
Coding
View GitHub Profile
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@tiagotex
tiagotex / add_env_variables_to_ebs_console.js
Last active February 27, 2023 12:41
Mass insert/update environment variables in AWS Elastic Beanstalk configuration
// I could not find a easy way to mass insert environment variables when migrating a project to EBS,
// this variables were in a config file so I decided to transform them into a array and write this script
// to allow easy insertion and update.
// To use this script fill the variables_array with your variables and then go to AWS Console,
// open your EBS environment, go to Configuration tab and then Software Configuration,
// you should see a table of Environment Properties. Open the browser console and use the scripts below.
// NOTICE: The combined size of all environment variables defined for an environment is limited to 4096 bytes.
// NOTICE: This script was done in January 2016, it might not work if AWS console is updated.
@dannycroft
dannycroft / exclude-node-modules
Last active February 27, 2019 18:25
Exclude node_modules out of Sublime Text 2 searches
// Add the following to your preferences file
"folder_exclude_patterns":[".git","node_modules"]
@adamtester
adamtester / page.html
Created May 10, 2013 08:58
Allows printing of another page without reloading or using ajax, should work in all browsers and as the frame is loaded after the W3 validator won't moan.
<div class="print_retroplan_div" id="print_retroplan_div" style="display:none;"></div>
@adamtester
adamtester / MY_Parser.php
Created May 9, 2013 08:35
Extends the CI Parser class to allow for language files to be parsed. With this instead of using <?php echo $this->lang->line('lineoftext'); ?> You can now use an underscore in your view files like so: {_lineoftext}. Enjoy cleaner view files!
<?php
/*
******************************************************************************
// Extends the CI Parser class to allow for language files to be parsed.
// With this instead of using <?php echo $this->lang->line('lineoftext'); ?>
// You can now use an underscore in your view files like so: {_lineoftext}
// Enjoy cleaner view files!
// Place this file in application/libraries/MY_Parser.php
******************************************************************************
@DHS
DHS / PHP Countries Array
Created November 4, 2011 18:51
PHP array of all country names
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island