Skip to content

Instantly share code, notes, and snippets.

@Xeus
Xeus / Ball.pde
Created October 4, 2012 19:00
Glitching Breakout
import java.awt.geom.*;
public class Ball {
Rectangle rectangle;
// BALL PROPERTIES --
int width = 5;
int height = 5;
boolean hasStroke = false;
color strokeColor = #FFFFFF;
boolean hasFill = true;
@Xeus
Xeus / genomesmidterm.pde
Created October 17, 2012 01:08
Understanding Genomes Midterm: Data Viz Tests for Galapag.us
int SIZE_BOX = 20;
int SIZE_BAR = 10;
int SIZE_GRID = 5;
color mindColor = color(255, 0, 0);
color heartColor = color(0, 255, 0);
color bodyColor = color(0, 0, 255);
import org.json.*;
String BASE_URL = "http://127.0.0.1:5000";
@Xeus
Xeus / values.md
Created December 25, 2012 06:01
Galapag.us Tribal Values

The Galapag.us Tribe

Our tribal values:

  • We believe that a primary goal of life is to maximize eudaimonia and to help others do the same.
  • We individuals own our own data, and can control its availability.
  • We believe in sharing and strength through interconnectedness.
  • We believe in transparency and accountability.
  • Our data is a powerful form of expression of our own identities, and we should be allowed to fully show and present that data identity and reputation in a free society.
  • We are each members of many tribes and have many identities and faces, and only through all layers combined can we be understood in context.
@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);
}
# 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 / 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
};
@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 / 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 / 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 / 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': {