Skip to content

Instantly share code, notes, and snippets.

Avatar

David Kivlehan funzeye

View GitHub Profile
@funzeye
funzeye / EncryptionService.cs
Created Oct 19, 2018
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.
View EncryptionService.cs
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))
View color-mix-light-part2
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);
View color-mix-light-part1
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;
@funzeye
funzeye / gist:f85f0b9773a428e31da6891b1a52cf2c
Last active Jun 3, 2016
Code for Love-o-meter - CoderDojo Session 2
View gist:f85f0b9773a428e31da6891b1a52cf2c
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);
@funzeye
funzeye / Hovergirl.markdown
Created Jul 10, 2014
A Pen by David Kivlehan.
View Hovergirl.markdown
@funzeye
funzeye / WordPress Advanced Custom Field - Responsive Image Field
Last active Nov 26, 2015
How To Use Responsive Images in WordPress using Advanced Custom Field's image field and the wp-tevko-responsive-images Plugin
View WordPress Advanced Custom Field - Responsive Image Field
<figure>
<?php
$image = get_field('your_image_field_name');
$atts = array(
'imageid' => $image,
'size1' => '0',
'size2' =>'600',
'size3' =>'1000'
);
echo tevkori_responsive_shortcode($atts) ; ?>