Skip to content

Instantly share code, notes, and snippets.

@carlynorama
carlynorama / execrpt-showcase.php
Created November 17, 2011 20:21
Sticky Posts With Recent Post - Step 1
<section class="recent-posts">
<?php
/**
* Begin the featured posts section.
*
* See if we have any sticky posts and use them to create our featured posts.
*/
$sticky = get_option( 'sticky_posts' );
// Proceed only if sticky posts exist.
if ( ! empty( $sticky ) ) :
@carlynorama
carlynorama / changes_to_functions.php
Created November 17, 2011 21:04
Create a more tag when it doesn't exist in a Wordpress Twenty Eleven Theme
<?PHP
//functions that need to be in the functions.php
//for this to work
//more tag detection
function has_more()
{
global $post;
if ( empty( $post ) ) return;
@carlynorama
carlynorama / childpages.php
Created November 17, 2011 21:55
Wordpress: Show Child Pages
<?php
/**
* Show Child Pages
* Works, no formating
* Must come after <?php the_post(); ?>
*/
$myID = $post->ID;
$highlighted_args = array(
'post_parent' => $myID,
@carlynorama
carlynorama / yogurtcup_sip_v0_1e_param_OpenSCAD.scad
Created April 6, 2012 16:13
Simple OpenSCAD model from the Yogurt Cup Self Irrigating Planter project
//globals
//sip_ indicates value for the basket
sip_radius = 27.5;
sip_height = 55;
sip_lip_radius = 42.5;
sip_wick_radius = 3;
sip_wall_thickness = 2;
@carlynorama
carlynorama / yogurtcup_sip_v0_1e_param_OpenSCAD.scad
Created April 6, 2012 16:15
Paramerized OpenSCAD model from the Yogurt Cup Self Irrigating Planter project
//---------------------------------------------------------------- GLOBALS
//-------------------------------------------------- Yogurt Container
//these are the values for the container itself
yc_bottom_e_radius = 56/2;
yc_top_e_radius = 80/2;
yc_wall_thickness = 0.5;
yc_floor_thickness = yc_wall_thickness;
yc_bottom_i_radius = yc_bottom_e_radius-yc_wall_thickness;
yc_top_i_radius = yc_top_e_radius-yc_wall_thickness;
@carlynorama
carlynorama / yogurtcup_sip_v0_1f_OpenJsCad.jscad
Created April 13, 2012 21:43
Simple OpenJsCad model from the Yogurt Cup Self Irrigating Planter project
function main() {
var resolution = 24; // increase to get smoother corners (will get slow!)
var thickness = 3;
var lip = CSG.cylinder({
start: [0, 55, 0],
end: [0, 58, 0],
radius: 42.5,
resolution: resolution
@carlynorama
carlynorama / BeeMail Code, First Circuit Test
Created January 29, 2014 17:34
This gist is a snapshot of code in the BeeMail repository written January 28th to 29th 2014
//This code is testing code for the circut to make sure all of the
//physical Arduino I/O is working. It checks a potentiometer or other
//sensors on the AO PIN and equates it to the future number of mails
//in the inbox.
//------------------------------------------------- OUTPUTS AND THEIR VARIABLES
int beePins[beeTotalNumber] = {9, 10, 11 };
//INPUTS AND THEIR VARIABLES
int howManyNewEmails = 0;
@carlynorama
carlynorama / remove_new_files
Created February 15, 2014 22:45
Finding files that are too new (less than a year old) and removing them.
# (find) in this directory (.) items of (-type) file (f) whose last modification (-mtime) was less than 365 days ago (-365)
# pipe the result into a file called newfiles.txt
find . -type f -mtime -365 > newfiles.txt
#look at newfiles.txt
cat newfiles.txt
#if everything listed is a malicious file
#run the find again, but instead of outputing to file
#run as a subprocess (-exec) the remove command (rm) on each result ({})
@carlynorama
carlynorama / TestCodeFor3Motors
Created February 27, 2014 19:24
This code is testing code for the circuit to make sure all of the //physical Arduino I/O is working. It checks a potentiometer or other sensor on the AO PIN and equates it to the future number of mails in the inbox. On each pin 9, 10 and 11 are 220 Ohm resistors leading to the bases of PN2222A transistors. The collector is attached to the motor …
//------------------------------------------------------------ START LICENSE
/*The MIT License (MIT)
Copyright (c) 2014 Carlyn Maw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@carlynorama
carlynorama / generateFilesOnSDcard.ino
Last active November 2, 2022 13:33
Creating a lot of files on an SD Card with an Arduino. Code complies. Keeping it as a reminder of how to work with String to char array conversion
void generateFiles() {
//derived from code found at http://forum.arduino.cc/index.php?topic=57460.0
String fileName = String();
String message = String();
unsigned int filenumber = 1;
while(!filenumber==0) {
fileName = "file_";
fileName += filenumber;
fileName += ".txt";
message = fileName;