Skip to content

Instantly share code, notes, and snippets.

View CRamsan's full-sized avatar
🏠
Working from home

Cesar Ramirez CRamsan

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python2.7
# Thanks to haochi for developing the personalcapital pip
# https://github.com/haochi/personalcapital
# Most of the work on this script is based on the main file from that repo.
from datetime import datetime, timedelta
from personalcapital import PersonalCapital, RequireTwoFactorException, TwoFactorVerificationModeEnum
import getpass
import json
var WebSocket = require('ws');
var http = require('https');
var messageBeat = '{"action":"echo","payload":{"test":"test"},"service":"event"}';
var messageRegister = '{"service":"event","action":"subscribe","worlds":["all"],"eventNames":["MetagameEvent"]}';
var validEnviroments = ['ps2', 'ps2ps4us', 'ps2ps4eu'];
var DEBUG = false;
var world_list = [
<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-3.1.0.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
(function($) {
var ViewModel = function(options) {
var self = this;
this.options = options;
this.url = 'http://census.daybreakgames.com/get/ps2:v2/outfit_member?c:limit=1000&c:resolve=online_status,character(name,battle_rank,profile_id)&c:join=type:profile^list:0^inject_at:profile^show:name.en^on:character.profile_id^to:profile_id&outfit_id='+this.options.outfit_tag;
this.Members = ko.observableArray([]);
@CRamsan
CRamsan / tardis.scad
Created August 12, 2014 08:19
TARDIS in OpenSCAD
//Ref: http://www.wikihow.com/Build-a-TARDIS-Replica
//Dimentions have been modified
//Place the bottom, ceiling and four bars
module tardisFrame()
{
//Base
cube([100, 100, 7.5]);
//Corner Posts
import websocket
import thread
import time
import json
def on_message(ws, message):
print message
json.loads(request.read().decode('utf8'))
def on_error(ws, error):
import urllib.request
import json
import time
import math
#Big outfits cannot be retrieved by one single calls so we will divide it in multiple calls
#Lets get the size of the outfit
request = urllib.request.urlopen("http://census.soe.com/count/ps2:v2/outfit_member/?outfit_id=37509488620628689")
outfit_size = json.loads(request.read().decode('utf8'))['count']
# Import a library of functions called 'pygame'
import pygame
import math
import random
# Define some colors
BLACK = ( 0, 0, 0)
WHITE = ( 255, 255, 255)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
@CRamsan
CRamsan / GetData.py
Last active August 29, 2015 14:00
Added columns for time per class, accuracy, kdr and outfit size
import urllib.request
import json
import time
with open("data.csv", "a") as data:
#request = urllib.request.urlopen("http://census.soe.com/get/ps2:v2/character/?character_id=5428010618041058369&c:limit=100&c:resolve=stat_history,online_status,world&c:join=type:world^inject_at:server&c:join=type:faction^inject_at:faction")
five_minutes_ago = int(time.time()) - (15 * 60)
request = urllib.request.urlopen("http://census.soe.com/get/ps2:v2/character/?c:limit=500&c:resolve=stat_history,world,outfit,stat&times.last_login=>1398389214")
characters = json.loads(request.read().decode('utf8'))['character_list']
data.write("Name|Battle Rank|Minutes Played|Faction|Server|Score/Minute|K/D Ratio|Accuracy|Outfit Size|INF|LA|ENG|MED|HEA|MAX\n")
@CRamsan
CRamsan / changepassword.php
Created October 1, 2012 04:28 — forked from mattrude/changepassword.php
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991