Skip to content

Instantly share code, notes, and snippets.

# python program to calculate pay
# pr4e exercise 3.1; pbhj
# assign variables to user values entered
# no checking yet
hrs = raw_input("Enter Hours: ")
h = float(hrs)
rate = raw_input("Enter Rate: ")
r = float(rate)
s = float(raw_input("Enter a score between 0.0 and 1.0: "))
# give grades for scores in range
# elif skips to end of else:
if s > 0.0 and s < 1.0:
if s >= 0.9:
print "A"
elif s >= 0.8:
print "B"
elif s >= 0.7:
@pbhj
pbhj / etc-init.d-plexmediaserver
Created January 19, 2015 22:13
/etc/init.d/plexmediaserver
k1210:~$ cat /etc/init.d/plexmediaserver
#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.
set -e
UPSTART_JOB_CONF="/etc/default/upstart-job"
INITSCRIPT="$(basename "$0")"
@pbhj
pbhj / jquery.marquee-20120900a.js
Created September 16, 2012 21:47 — forked from remy/gist:2484402
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
* pbhj 20120900: altered $marquee.attr('loop') to $marquee.prop('loop') as suggested in a comment on original github gist
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;
@pbhj
pbhj / Groot-compromised-hosts
Last active October 16, 2016 22:08
A hosts file based on "Compromised stores that contain Javascript malware (scanned at 14th October 2016). See http://gwillem.gitlab.io/2016/10/14/github-censored-research-data/".
# see https://gitlab.com/gwillem/public-snippets/snippets/28813
# list of hosts in "null routed /etc/hosts" file format
# these hosts were considered to be running compromised software as of October 2016
0.0.0.0 00-lawyer.com
0.0.0.0 1001-amulette.de
0.0.0.0 1001tablecloths.co.uk
0.0.0.0 1001tafelkleden.com
0.0.0.0 1010buybuy.com
0.0.0.0 1136500562.rsc.cdn77.org
Zafira B
111306
160638
161450
161600
000000 + 8 flashes, then 3 flashes of engine check light
030300
032500
111306
@pbhj
pbhj / postrm_script_for_edubu-art.sh
Created August 14, 2018 20:59
postrm script for edubu-art
#!/bin/sh
set -e
case "$1" in
remove)
# Restore Breathe icons diversions (we need a better way to do this)
dpkg-divert --quiet --rename --package edubuntu-artwork --remove /usr/share/icons/Breathe/16x16/places/start-here.png
dpkg-divert --quiet --rename --package edubuntu-artwork --remove /usr/share/icons/Breathe/22x22/places/start-here.png
dpkg-divert --quiet --rename --package edubuntu-artwork --remove /usr/share/icons/Breathe/24x24/places/start-here.png
dpkg-divert --quiet --rename --package edubuntu-artwork --remove /usr/share/icons/Breathe/32x32/places/start-here.png
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G
CPU Family: 0x15
javascript:var css = 'a:after{content:" (" attr(href) ") ";}', style = document.createElement('style'); style.type = 'text/css'; style.appendChild(document.createTextNode(css)); document.head.appendChild(style);
@pbhj
pbhj / .mozilla_firefox_$profile_userContent.css
Last active May 17, 2019 10:07
modify date format on stackoverflow and stackexchange sites using userContent.css for Firefox
/*
* Please share improvements here or on StackOverflow and add a link here.
* Please upvote https://meta.stackoverflow.com/questions/288674/custom-date-format/385090#385090 if you agree that
* users should have a choice of date format available.
*
* - see https://developer.mozilla.org/en-US/docs/Web/CSS/@document
* - https://www.regextester.com/ may be useful too, but careful of the double escaping!
* keywords: date format, date display, stackoverflow, stackexchange, css, script
*/