Skip to content

Instantly share code, notes, and snippets.

@cslott
cslott / gist:4035824
Created November 8, 2012 01:25
Pointers and Memory Addresses - CSFE 8.2
int main (void)
{
char address = "abc123";
printf(address);
return 0;
// 0100 0001 - 41 (upper case 'A')
// 0110 0001 - 61 (lower case 'a')
@cslott
cslott / gist:4043341
Created November 9, 2012 02:28
Pointers again - CSFE 8.3
char my_char = 'a';
// somewhere we have: address of my_char 0110 0001 <-- 'a'
// ...
// 0111 - 0000 0101 <-- 5
// 1000 - 0110 0001 <-- 'a'
// 1001 - 1101 0011 <-- unrelated data
// ...
@cslott
cslott / gist:4043344
Created November 9, 2012 02:29
Creating Pointers - CSFE 8.4
unsigned short int total = 50250;
// unsigned short takes up "two bytes"
// 1100 0100 0100 1010 = 50250
//..
// 1000 - 1100 0100
// 1001 - 0100 1010
//..
@cslott
cslott / gist:4049613
Created November 10, 2012 02:39
Returning Stuff - CFSE
int main (void)
{
int total = 5;
printf ("The total is: %d; then %d; then %d; then %d.", total, 6, total + 3, printf("1234567"));
return 0;
}
@cslott
cslott / gist:4049683
Created November 10, 2012 03:04
Programming PHP - Week 1 Day 1 - Hello World
<?php
echo 'Hi, good ol\' world!';
?>
@cslott
cslott / gist:4049808
Created November 10, 2012 04:01
Variables PHP - Week 1 Day 2
<?php
// Interger Variables
$firstIntegerVariable = 26;
$secondIntegerVariable = 13;
$thirdIntegerVariable = $firstIntegerVariable + $secondIntegerVariable;
// String Variable
$firstStringVariable = "This is a sentence with punctuation.";
@cslott
cslott / gist:4091411
Created November 16, 2012 22:19
Logic PHP - Week 2 Day 1
<?php
// Logic.php
$number = 11;
if ($number < 10)
{
echo "Less than 10";
}
@cslott
cslott / index.html
Created January 8, 2013 03:06
Processing.js
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>$title</title>
$styles
</head>
<body>
<h1>$title</h1>
@cslott
cslott / gist:4541617
Last active December 11, 2015 03:58
Codecademy - CSS
<!--
<!DOCTYPE html>
<html></html>
<head></head>
<body></body>
<p></p>
style="background-color: red";
@cslott
cslott / dabblet.css
Last active December 11, 2015 04:08
Learn HTML & CSS - Codecademy
/**
* Learn HTML & CSS - Codecademy
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;