Skip to content

Instantly share code, notes, and snippets.

View iannase's full-sized avatar
🎯
Focusing

Ian Annase iannase

🎯
Focusing
View GitHub Profile
@iannase
iannase / gpa.cpp
Last active December 5, 2016 18:51
C++ tool to calculate a student's future GPA. The student can see how their current semester will affect GPA. The student can also see what their GPA will be at the time of graduation
// This program is designed to calculate the future GPA needed to
// raise a student's current GPA to a certain level
// Created by Ian Annase
// Last modified December 5, 2016
// Copy and paste it to http://cpp.sh/ to run it
#include <iostream>
#include <iomanip>
using namespace std;
@iannase
iannase / space.cpp
Last active January 23, 2017 22:55
An educational space application
// Travel through space with this educational C++ application
// Created by Ian Annase
#include <iostream>
using namespace std;
// function definitions
void Menu();
void Spaceship();
void BackToEarth();
@iannase
iannase / makefile
Last active March 27, 2017 01:15
Space bash script
all: space.cpp
g++ -g -Wall -std=c++11 space.cpp -o space1
@iannase
iannase / LuminosityCalculator.cpp
Created January 21, 2017 21:15
* Calculate the luminosity, precise star type, and habitable zone of a star based on its surface temperature and radius.
/* Ian Annase
* January 21, 2017
* Calculate the luminosity, precise star type, and habitable zone of a star based on
* its surface temperature and radius.
*/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
@iannase
iannase / adMob.swift
Last active June 8, 2017 22:54
Google AdMob - all code needed to get an interstitial ad working in an app
import GoogleMobileAds
class FirstViewController: UIViewController, UITextFieldDelegate, GADInterstitialDelegate {
// Your ad as a variable
var interstitialAd: GADInterstitial?
// Creates and loads an interstitial
func createAndLoadInterstitial() -> GADInterstitial {
let request = GADRequest()
@iannase
iannase / review.swift
Last active June 20, 2017 16:47
iOS - Launch review if it's the first time opening and ad if it's not
let when = DispatchTime.now() + 1 // change 1 to desired number of seconds
let launchedBefore = UserDefaults.standard.bool(forKey: "launchedBefore")
DispatchQueue.main.asyncAfter(deadline: when) {
if #available(iOS 10.3, *){
if !launchedBefore {
SKStoreReviewController.requestReview()
UserDefaults.standard.set(true, forKey: "launchedBefore")
} else {
self.interstitialAd = self.createAndLoadInterstitial()
}
@iannase
iannase / usd2btc.js
Created August 23, 2017 16:19
Jquery to convert usd to bitcoin as the user is typing. Uses an html input
$('#sc_uea_custom_amount_1').keyup(function(){
var url = "https://blockchain.info/tobtc?currency=USD&value=";
var value = this.value;
var url2 = url + value;
$.get(url2, function(data){
var returnText = '≈ ' + data + ' BTC';
$('#input1').val(returnText);
});
});
import UIKit
import AVFoundation
class ViewController: UIViewController, AVAudioPlayerDelegate {
var audioPlayer: AVAudioPlayer!
let soundArray = ["note1.wav", "note2.wav", "note3.wav", "note4.wav", "note5.wav", "note6.wav", "note7.wav"]
override func viewDidLoad() {
super.viewDidLoad()
let alert = UIAlertController(title: "Awesome", message: "You've finished all the questions. Do you want to start over?", preferredStyle: .alert)
let restartAction = UIAlertAction(title: "Restart", style: .default, handler: { (UIAlertAction) in
self.startOver()
})
alert.addAction(restartAction)
present(alert, animated: true, completion: nil)
//
// ViewController.swift
// ARDicee
//
// Created by Ian on 9/30/17.
// Copyright © 2017 IanAnnase. All rights reserved.
//
import UIKit
import SceneKit