Skip to content

Instantly share code, notes, and snippets.

View topherPedersen's full-sized avatar
💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / alamofire_example.swift
Created March 1, 2019 09:59
Basic Alamo Fire (Version 4) Example
//
// ViewController.swift
// HelloAlamofire1
//
// Created by Christopher Pedersen on 2/28/19.
// Copyright © 2019 Christopher Pedersen. All rights reserved.
//
import UIKit
import Alamofire
@topherPedersen
topherPedersen / realm_example.swift
Created March 1, 2019 10:00
Basic Realm Database for iOS Example
//
// ViewController.swift
// HelloRealm
//
// Created by Christopher Pedersen on 2/25/19.
// Copyright © 2019 Christopher Pedersen. All rights reserved.
//
import UIKit
import RealmSwift
@topherPedersen
topherPedersen / allowhttp.xml
Created March 4, 2019 07:40
Allow HTTP in iOS App
<!-- Add This Code Snippet to Your Info.plist file on iOS to use HTTP -->
<key>NSAppTransportSecurity</key>
<dict>
<!--Include to allow all connections (DANGER)-->
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
@topherPedersen
topherPedersen / Info.plist
Created March 4, 2019 07:45
Complete Info.plist Featuring Code Snippet to Allow for HTTP
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
@topherPedersen
topherPedersen / aaravRockPaperScissors.html
Created March 5, 2019 22:55
Aarav's Rock Paper Scissors Assignment
<!DOCTYPE html>
<html>
<head>
<style>
/* Aarav, your CSS goes HERE, In Between the Style Tags */
#mySuperSweetID {
border-style: dotted;
color: red;
background-color: blue;
}
@topherPedersen
topherPedersen / jinja2_control_structures.html
Created March 17, 2019 08:34
Jinja2 Control Structures
<!--
Working out of Miguel Grinberg's Flask Web Development (2nd Edition)
trying to teach myself a little Flask for a new project on which I'm
working, so here is a little code straight from Grinberg's book
demonstrating the basics of using control structures in Flask's Jinja2
templating language:
-->
<!-- Conditionals -->
{% if user %}
@topherPedersen
topherPedersen / learn_swift_in_20_minutes.swift
Last active March 23, 2019 17:52
Learn Swift in 20 Minutes
/* Learn Swift in 20 Minutes Tutorial by Krishi K. & Chris P. */
// Concept No. 1: FUNCTIONS
print("Print is a function.")
print("Functions are commands that instruct the computer to do things.")
print("Although, sometimes they are used to return values as well.")
// Concept No. 2: Variables
var myVariable = "Variables are simply containers which hold values."
print(myVariable)
@topherPedersen
topherPedersen / string_reversal.swift
Last active March 27, 2019 22:43
String Reversal Tool (Assignment) in Swift by Jonathan S
/*
REFERENCE: Text Based Interface in Swift
print("Enter text here> ")
var userInput = readLine()!
print("User entered: \(userInput)")
*/
@topherPedersen
topherPedersen / magic8ball.py
Created March 28, 2019 19:44
Magic 8 Ball for Python 3
# Magic 8 Ball by Chris Pedersen
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
import random
# Greet the User
print("Welcome to Magic 8 Ball!")
# Create Game Loop
@topherPedersen
topherPedersen / command_line_interface.lol
Created March 30, 2019 19:50
Command Line Interface in LOLCODE
HAI 1.2
VISIBLE ">>> "!
I HAS A SUPERSWEETVARIABLE
GIMMEH SUPERSWEETVARIABLE
VISIBLE SUPERSWEETVARIABLE
KTHXBYE