Skip to content

Instantly share code, notes, and snippets.

View dannycjones's full-sized avatar

Daniel Carl Jones dannycjones

View GitHub Profile
@dannycjones
dannycjones / bp.yaml
Last active September 9, 2023 11:40
messing with blueprints, ignore
blueprint:
name: ZHA - Philips Hue Dimmer Switch - V2
description: |
Control lights with a Philips Hue Dimmer Switch.
The top "on" button behaviour is adjustable. By default it behaves like this:
- Press it while the light is off, and the light will turn on to the last set brightness.
- Press it again while the light is on, the light will turn to the fixed brightness setting.
Dim up/down buttons will change the brightness smoothly and can be pressed

Roles

President

The leader of the society. Tasked with setting the vision and leading strategic direction.

  • Always thinking ahead.
  • Always looking for opportunities to pursue. e.g. MLH have released a new workshop, how should we act on this?
  • ‎Always looking for ways to improve the society as a whole. What could we improve on for our next event?
  • Delegate across the committee as equally as possible, ensuring no one person is burdened with too much work.

Keybase proof

I hereby claim:

  • I am dannycjones on github.
  • I am dannycjones (https://keybase.io/dannycjones) on keybase.
  • I have a public key ASDEcdspZKj73gUaEZ40ryBrnpGmOZh0tJA_WpvR6Cnj1Ao

To claim this, I am signing this object:

fizzBuzz :: [Int] -> [String]
fizzBuzz listOfNumbers = [fizzify x | x <- listOfNumbers]
where
fizzify :: Int -> String
fizzify num
| fizz && buzz = "FizzBuzz"
| fizz = "Fizz"
| buzz = "Buzz"
| otherwise = show num
where fizz = num `mod` 3 == 0
@dannycjones
dannycjones / euclids.rb
Last active June 2, 2016 08:13
An implementation of Euclid's algorithm in Ruby finding the highest common factor for two numbers.
def euclids(a, b) # Euclid's Algorithm
quotient = a / b
remainder = a % b # modulo
puts "#{a} = #{quotient}(#{b}) + #{remainder} [hcf(#{a}, #{b})]"
return b if remainder.zero?
euclids(b, remainder)
end
def hcf(a, b)
euclids(a, b)
@dannycjones
dannycjones / Daniel Carl VB Splash.vb
Last active June 2, 2016 07:24
A Simple Console Splash Screen in Visual Basic
Module Logo
Sub Print(Optional ByVal wait As Integer = 0)
Dim logo_lines(6) As String
Console.Title = "A Project By Daniel Carl"
Console.ForegroundColor = ConsoleColor.Cyan
logo_lines(0) = " "
logo_lines(1) = " ___ _ __ _____ __"
logo_lines(2) = " / _ \___ ____ (_)__ / / / ___/__ _____/ /"
logo_lines(3) = " / // / _ `/ _ \/ / -_) / / /__/ _ `/ __/ / "
logo_lines(4) = " /____/\_,_/_//_/_/\__/_/ \___/\_,_/_/ /_/ "
@dannycjones
dannycjones / announcements.html
Created December 9, 2013 13:33
A Fancy, but simple announcements box with animated background.
<style>
@keyframes animate-bg
{
from {background-position:0px 0px;}
to {background-position:-40px -40px;}
}
@-webkit-keyframes animate-bg
{
from {background-position:0px 0px;}
to {background-position:-40px -40px;}
@dannycjones
dannycjones / Status Box.css
Last active December 29, 2015 22:29
A Status Box that can be used to manually show the status of sections of your community.
/* Modify the code here in order to style the Status Box */
.report_problem {
font-size: 9pt;
color: #1E90FF;
font-style:italic;
}
.status_title {
font-weight:600;
display:none;
/* Credit to https://gist.github.com/commadelimited/4958196 for the first section (slightly modified) */
function harlemShake() {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
console.info("specialRep Javascript Loaded.");
var specialRepUsers = [];
var specialRepInterval;
function UserObj(memberID, repMsg, background, prob) {
this.memberID = memberID;
this.repMessage = repMsg;
this.bgColor = background;
this.prob = prob;