This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Button button = (Button) findViewById(R.id.button); | |
button.setOnClickListener(new View.OnClickListener() { | |
public void onClick(View v) { | |
// do stuff | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent i = new Intent(this, NewActivity.class); | |
i.putExtra(EXTRA_FOO, "bar"); | |
startActivity(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exemplo de requisição GET | |
var ajax = new XMLHttpRequest(); | |
// Seta tipo de requisição e URL com os parâmetros | |
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true); | |
// Envia a requisição | |
ajax.send(); | |
// Cria um evento para receber o retorno. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: This Magic 8 Ball Tutorial in Swift is for my personal reference | |
// teaching students at theCoderSchool in Flower Mound, TX | |
// This isn't a full blown application, just two swift files | |
// combined into one github gist for reference when assisting | |
// students with their "Magic 8 Ball" assignment. This app consists | |
// of one view containing a label, a text field, and a button. | |
// Users enter their question into the text field and then press | |
// the button to submit their question. The app then answers the user | |
// using a simple UIAlertController (alert/dialog popup). Students | |
// need to connect the button from their main storyboard to the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist includes the two main files from a SpriteKit app for iOS and is for my personal reference | |
// teaching my app team students how to create 2D games for iOS using SpriteKit | |
// | |
// GameScene.swift | |
// HelloSpriteKit | |
// | |
// Created by Christopher Pedersen on 7/8/18. | |
// Copyright © 2018 Christopher Pedersen. All rights reserved. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist is comprised of two swift files which demonstrate how to do | |
// vertical scene scrolling with SpriteKit using two images. This code | |
// is based on the example app from 'Beginning Swift Games Development for iOS' | |
// by James Goodwill and Wesley Matlock. In Goodwill's example app from the | |
// book, SuperSpaceMan, the app uses a single background image for scene | |
// scrolling, and scrolling is limited to the size of the single background. | |
// I was interested in achieving the same effect using multiple images to | |
// allow for further scrolling, so I've gone ahead and modified Goodwill's | |
// app and posted it here for my own personal reference. Specifically, this | |
// code is being posted for use in my app team class at theCoderSchool in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
print("Welcome to Magic 8 Ball!") | |
var keepPlaying = true | |
while keepPlaying == true { | |
// Prompt user to ask Magic 8 Ball a question | |
print("What is your question? ") | |
// We use the variable name '_' underbar below instead of something more |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Pong by Peter Kwak | |
# Developed as a tutorial for students theCoderSchool in Flower Mound, TX | |
# https://imgur.com/a/5uN2r5L | |
# https://imgur.com/a/FOCWN7R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This sample code is for reference teaching students Python at theCoderSchool in Flower Mound, TX | |
class Student: | |
def __init__(self, name, gradeLevel, average): | |
self.name = name | |
self.gradeLevel = gradeLevel | |
self.average = average | |
chris = Student("Chris", 12, 88) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code was written by the team at www.trinket.io for use in their trinket.io | |
# web based integrated python development environment. The game may need some | |
# modification to work using the standard Python 2.7 distribution. This code | |
# has been posted here to my personal github profile for reference purposes | |
# related to my teaching duties at theCoderSchool in Flower Mound, TX. | |
# This code is from the public domain, is free to use and modify, and does | |
# not require a software license of any kind. | |
# Click in the righthand window to make it active then use your arrow | |
# keys to control the spaceship! |
OlderNewer