Skip to content

Instantly share code, notes, and snippets.

Noah Overcash smileytechguy

Block or report user

Report or block smileytechguy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View snippet.php
<?php
case "ADDSKU":
$skus = $dbh->query("SELECT * FROM `".DB_SKU_NAME_TABLE."`;")->fetchAll();
$skuAssocArray = [];
foreach ($skus as $sku) {
$skuAssocArray[$sku["SKU"]] = $sku["NAME"];
}
View buildMultipartFormData.php
<?php
/**
* Build multipart/form-data
*
* @param array @$data Data
* @param array @$files 1-D array of files where key is field name and value if file contents
* @param string &$contentType Retun variable for content type
*
* @return string Encoded data
*/
View gist:1c8243d5adb91753d7822b64aff06969
String[] buttonTexts = new String[] {"m+", "m-", "mc", "mr", "ms", "CE/C", "¹⁄ᵪ", "x²", "√", "⁺⁄₋", "rand", "AC", "floor", "ceil", "++", "--", "round", "eᵡ", "sin", "cos", "tan", "", "DEG", "SCI", "sin⁻¹", "cos⁻¹", "tan⁻¹", "e", "10ᵡ", "÷", "log", "ln", "(", ")", "", "✕", "^", "π", "7", "8", "9", "–", "x³", "∛", "4", "5", "6", "+", "abs", "%", "1", "2", "3", "=", "OFF", "isint", "0", ".", "(−)"};
View test.java
public static String expandNumToDigits(int in, int digits) {
String stringIn = ""+in;
while (stringIn.length() < digits) {
stringIn = "0"+stringIn;
}
return stringIn;
}
View incremental_rand_sort.php
<?php
class CardDeck {
public $deck = Array();
public function __construct(int $size) {
for ($i=1; $i <= $size; $i++) {
$this->deck[] = Array($i);
}
View suggestions.txt
https://github.com/smileytechguy/sample_projects
https://github.com/smileytechguy/sample_projects/search?l=Java
100_doors - intermediate challenge, requires multiple loops and a boolean array
guess_user_number - binary search, computer guesses number, user says higher/lower
even_fibonacci - find a sum of the even numbers in the first x numbers in the fibonacci sequence
palindromes - there are several in GH, ex largest_palindrome_product, however string palindromes are better
you could make it indifferent to cases, spaces, etc
number_letter_counts - thing about getting the number of letters in a spelled out number (one, two etc)
number_spiral - hard. extra credit if you give it. generating a spiral of numbers in a 2d array
View gist:6b1a80edfe37c4c9fbbe88ed2e73d25b
Human fills spot 2
0 returns a score of -10
1 returns a score of 0
3 returns a score of -10
4 returns a score of 0
5 returns a score of -10
6 returns a score of 0
7 returns a score of -10
8 returns a score of -10
@smileytechguy
smileytechguy / exif_orientation.md
Last active Dec 23, 2016
Why photos taken on a modern device may appear incorrectly rotated:
View exif_orientation.md

Why photos taken on a modern device may appear rotated incorrectly:

Originally written as an explainiation for my Precalculus teacher as to why student's work render incorrectly in Google Classroom.

Image metadata (EXIF)

Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications) is a standard which allows for metadata to be stored in an image or audio file. This is important, as it can store information about the image besides the image itself. Common applications include things such as date taken, shutter speed, camera type, or location, however any aribtrary key and value may be stored. A few keys are required, such as the use of the Discrete Cosine Transformation (DCT) on image/jpeg files, various algorithms and codecs used for processing RIFF files such as audio/wav A photo taken on a modern device, such as an iPhone or similar, can contain dozens if not hundreds of these tags, however those found in most images are things such as bit depth, colour palette,

You can’t perform that action at this time.