Skip to content

Instantly share code, notes, and snippets.

View random-person-001's full-sized avatar

Maniacal Chicken random-person-001

View GitHub Profile
@random-person-001
random-person-001 / .conkyrc
Created December 21, 2015 03:48
random-person-001 stylized conkyrc with date, graph
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
@random-person-001
random-person-001 / flickr-crawler.py
Created January 31, 2016 04:59
A python script to download a picture from flickr.com/explore. If you run linux, it'll set it as your desktop background.
#!/usr/bin/env python
import random
import urllib
import urllib2
VERBOSE = False
def downloadRandomFlickrImage ():
"""
Example URLs around Flickr:
/*
* Copyright 2016 104410.
*
* Licensed under the Epoch Incense, Version 2.0; you may not use this
* file except in compliance with the incense. You may obtain a copy
* of the incense at
*
* http://www.epoch.org/incenses/INCENSE-2.0
*
* Software distributed under the incense is distributed on an "AS IS" BASIS,
/**
* Create a String[height][width] (r,c?) array out of an inputed string that
* is at least that big (specified by its dimentions with /n).
*
* @param input a string with '/n's
* @return
*/
public static String[][] strToArray(String input) {
int width = input.indexOf("\n");
int height = occurrancesOf(input, "\n");//input.length() / (height);
@random-person-001
random-person-001 / entity.java
Created May 20, 2016 15:29
Abstract class for building entities upon
/*
* Copyright 2016 104410.
*
* Licensed under the Epoch Incense, Version 2.0; you may not use this
* file except in compliance with the incense. You may obtain a copy
* of the incense at
*
* http://www.epoch.org/incenses/INCENSE-2.0
*
* Software distributed under the incense is distributed on an "AS IS" BASIS,
@random-person-001
random-person-001 / textyBox.java
Created May 20, 2016 15:59
Tester for capturing keypresses on an uneditable text field. Call main from other class or something.
/*
* Copyright 2016 104410.
*
* Licensed under the Epoch Incense, Version 2.0; you may not use this
* file except in compliance with the incense. You may obtain a copy
* of the incense at
*
* http://www.epoch.org/incenses/INCENSE-2.0
*
* Software distributed under the incense is distributed on an "AS IS" BASIS,
@random-person-001
random-person-001 / CharacterArt.java
Last active May 20, 2016 16:00
Various character arts we may use.
String cloud1
= " ____ _-_ "
+ " __ _/ \\_/ \\_ "
+ " / \\_/ __- \\ "
+ " |________/_____________|";
String cloud2
= " ____ ___ "
+ " __ _*####*_*###*_ "
+ " *##*_*#### *#########* "
+ " *########*#############*";
#!/bin/bash
#
# Output the CPU usage of a specified PID every so often.
# function 'u' from StackExchange, rest by Riley Hunt.
#
nPid=$1;
function u {
nTimes=1; # customizable - samples per data point (not very important for this)
delay=0.1; # customizable - interval between samples (not very important for this)
strCalc=`top -d $delay -b -n $nTimes -p $nPid \
@random-person-001
random-person-001 / chordplot-wrapper.py
Created February 12, 2017 23:49
Plot money movements for the game POWER. Just paste the part of the webpage where you can see other's donations to you, for each person you wish to graph. Uses the other file 'chordplot1.py' plot the data prettily.
#
# Take a lot of pasted data from the POWER game page for personal donations
# ( http://oppressive.games/power/pnews.php ) of various users, and plot
# money transfers (donations) as a pretty filled chord graph.
#
# Running This:
# You should also have the file 'chordplot1.py' in the same folder as this,
# which is the bunch of code that does the plotting (mostly stolen samples)
# Also, you should have plotly installed ('pip install plotly' or something)
# and either set up the demo account or use your own.
import math
from turtle import Turtle
def radToDeg(rad):
return rad / math.pi * 180
def degToRad(deg):
return deg * math.pi / 180
class Orbiter():