Skip to content

Instantly share code, notes, and snippets.

@Xeus
Xeus / keybase.md
Last active August 29, 2015 14:01
keybase.md

Keybase proof

I hereby claim:

  • I am xeus on github.
  • I am xeus (https://keybase.io/xeus) on keybase.
  • I have a public key whose fingerprint is 8FA7 348F 6A7B 744C 323D 2B38 0D6D 6191 4294 3BB9

To claim this, I am signing this object:

@Xeus
Xeus / new_instance_latest.sh
Last active August 29, 2015 14:00
Bash script to install latest versions. Still needs some adjusting (particularly for Apache 2.4 and nginx w/ PHP).
#!/bin/bash
#
# updated 14/04/16
set -o nounset
set -o errexit
cd ~
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python tcl git nodejs npm build-essential zlib1g-dev libbz2-dev libreadline-dev openssl python-setuptools g++ make php5-curl supervisor mysql-client php5-mcrypt php5-mysql phpunit libapache2-modsecurity libssl-dev curl git-core htop rubygems python-pip python-dev openjdk-7-jre-headless curl xml2 libxml2-dev libxslt-dev python-software-properties python3 mysql-server imagemagick software-properties-common libpcre3 libpcre3-dev unzip
# install openssh-server
@Xeus
Xeus / age_gate_snippet.html
Created February 12, 2014 17:55
Age Gate snippet
<script>
var countryAges = {
'ageDefault': 18,
'albania': 0,
'angola': 0,
'armenia': 0,
'cambodia': 0,
'comoros': 0,
'cuba': 0,
@Xeus
Xeus / logging.py
Created October 14, 2013 18:45
Django & Python logging
// via rh0dium @ http://stackoverflow.com/questions/5739830/simple-log-to-file-example-for-django-1-3
// I truly love this so much here is your working example! Seriously this is awesome!
//
// Start by putting this in your settings.py
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
@Xeus
Xeus / test_assert.js
Last active December 25, 2015 09:59
JS Assert for Input Checking
var assert = function(condition, msg) {
if (!condition) {
// throw message || "Assertion failed";
console.log('FAIL ----- ' + msg);
}
else {
console.log('PASS ----- ' + msg);
}
};
@Xeus
Xeus / gist:6222726
Created August 13, 2013 16:05
mysql basics
$ mysql -u root
If a password is required, use the extra switch -p:
$ mysql -u root -p
Enter password:
Now that you are logged in, we create a database:
mysql> create database test;
@Xeus
Xeus / site_checklist.txt
Created August 6, 2013 23:00
site checklist
- jslint
- qunit
- grunt
- html5 validation: http://validator.w3.org/
- ssl test: https://www.ssllabs.com/ssltest/index.html
@Xeus
Xeus / nodejs_beast.js
Created August 6, 2013 22:55
BEAST attack mitigation on node.js
// via http://www.ericmartindale.com/2012/07/19/mitigating-the-beast-tls-attack-in-nodejs/
var options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
ciphers: 'ECDHE-RSA-AES256-SHA:AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
honorCipherOrder: true
};
# the admin password for all of the IE VMs is “Password1″ without the quotes, it's also used for the password hints
1) Install VirtuaBox on your mac
http://download.virtualbox.org/virtualbox/4.1.10/VirtualBox-4.1.10-76795-OSX.dmg
2) Decide which versions of Internet Explorer you want to download and install – each version of Internet Explorer is contained within a separate virtual machine that runs within VirtualBox. In other words, if you want to run Internet Explorer 7, 8, and 9, you will need to download three separate VM’s, which may take a while so keep that in mind. Select the text below and copy it:
# Install ALL versions of Internet Explorer: IE 7, IE 8, and IE 9 (for now this script will also pull down a IE 6 vm with windows xp)
@Xeus
Xeus / gist:5903651
Created July 1, 2013 19:11
Get all JavaScript variables from dev console.
for(var b in window) {
if(window.hasOwnProperty(b)) console.log(b);
}