Skip to content

Instantly share code, notes, and snippets.

View funzeye's full-sized avatar

David Kivlehan funzeye

View GitHub Profile
@funzeye
funzeye / WordPress Advanced Custom Field - Responsive Image Field
Last active November 26, 2015 21:53
How To Use Responsive Images in WordPress using Advanced Custom Field's image field and the wp-tevko-responsive-images Plugin
<figure>
<?php
$image = get_field('your_image_field_name');
$atts = array(
'imageid' => $image,
'size1' => '0',
'size2' =>'600',
'size3' =>'1000'
);
echo tevkori_responsive_shortcode($atts) ; ?>
@funzeye
funzeye / Hovergirl.markdown
Created July 10, 2014 10:16
A Pen by David Kivlehan.
@funzeye
funzeye / gist:f85f0b9773a428e31da6891b1a52cf2c
Last active June 3, 2016 13:11
Code for Love-o-meter - CoderDojo Session 2
if (temperature < baselineTemp)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if (temperature >= baselineTemp+2 && temperature < baselineTemp+4)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
const int greenLEDPin = 9;
const int redLEDPin = 11;
const int blueLEDPin = 10;
const int redSensorPin = A0;
const int greenSensorPin = A1;
const int blueSensorPin = A2;
int redValue = 0;
int greenValue = 0;
redSensorValue = analogRead(redSensorPin);
delay(5);
greenSensorValue = analogRead(greenSensorPin);
delay(5);
blueSensorValue = analogRead(blueSensorPin);
Serial.print("Raw Sensor Values \t Red: ");
Serial.print(redSensorValue);
Serial.print("\t Green: ");
Serial.print(greenSensorValue);
@funzeye
funzeye / EncryptionService.cs
Created October 19, 2018 15:26
Encryption and decryption in a .NET application using AES Rijndael with autogen IV. Symmetric Cipher Key accessed from config file. Recommend you encrypt key in config also.
public class EncryptionService : IEncryptionService
{
private const int Keysize = 256;
public string Encrypt(string plainText)
{
var toEncryptBytes = Encoding.UTF8.GetBytes(plainText);
using (var provider = CreateCipher())
{
using (var encryptor = provider.CreateEncryptor(provider.Key, provider.IV))