Skip to content

Instantly share code, notes, and snippets.

View rurtubia's full-sized avatar

Randy Urtubia rurtubia

View GitHub Profile
@rurtubia
rurtubia / html_fragment_link.html
Last active August 29, 2015 14:22
HTML links with the anchor element: <a>
@rurtubia
rurtubia / add_border_to_image_css.html
Last active August 29, 2015 14:22
Changing the size of an image with CSS, adding borders to it and changing its style and border-radius
<style>
.thick-border {
border-width: 10px;
border-style: solid;
}
</style>
<img class='thick-border'
src='https://bit.ly/fcc-kittens'/>
@rurtubia
rurtubia / degrading_from_googlefont_to_normal.html
Last active August 29, 2015 14:22
Example of a webpage using the Google fonts API Ejemplo de página web usando la API Google fonts:
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
@rurtubia
rurtubia / css_color.html
Last active August 29, 2015 14:22
CSS color all elements in a webpage inside the webpage HTML From http://www.freecodecamp.com/challenges/waypoint-use-css-selectors-to-style-elements
<style> h2 {color:blue;}</style>
@rurtubia
rurtubia / MasterViewController.swift
Created May 30, 2015 05:59
tableView function in iOS
override func tableView (tableView: UITableView,
commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
func tableView:
A table view is the scrolling thing that's containing all the dates in the
example project, and is a core component in iOS.
tableView: UITableView
contains two pieces of information:
tableView
@rurtubia
rurtubia / XCode Configuration
Created May 29, 2015 22:04
How to use Github in different IDEs
1. Launch XCode 4
2. Select the ‘Connect to a repository’ option from the ‘Welcome to XCode’ dialog.
3. Paste in your GitHub SSH URL in the Location text box. This can be found from your GitHub repository’s Source page. e.g. [email protected]:<organisation>/<repository>.git
4. Click Next and then give the repository a name (e.g. RepositoryName) and click Clone.
5. Pick a directory to clone your GitHub repository into (even if your repository is currently empty).
@rurtubia
rurtubia / classes.py
Last active October 17, 2025 13:54
Classes in Python
#Objects and classes
# Classes let us define the blueprints for objects
from calendar import weekday
class Animal:
# When defining a class's attributes, if they are preceded by __, it means they are private
__name = ''
__height = 0
@rurtubia
rurtubia / file_io.py
Created May 29, 2015 16:48
File I/O in Python
# we need to import the os module to be able to delete a file
import os
# Creating and opening a file
# to read and append to file, we use the command 'ab+' -it also opens and creates a file
# to write to this file, we use the command 'wb'
test_file = open('test.txt', 'wb')
# Finding out which file mode is in use
@rurtubia
rurtubia / functions_substring.py
Created May 29, 2015 16:12
Substring functions in Python
# printing a substring:
long_string = 'this is a pretty long and boring string'
# to print the first three characters:
print(long_string[0:3])
# to print the last three characters:
print(long_string[-3:])
# to print everything except the last three characters:
print(long_string[:-3])
@rurtubia
rurtubia / functions.py
Created May 29, 2015 16:09
Functions in Python
#sys is imported to get input:
import sys
# A function's definition starts with the keyword def
# after that, parameters can be added inside the parenthesis
# those parameters can be used and returned as defined in the function body
def addNumber(firstNumber, lastNumber):
sumNumbers = firstNumber + lastNumber
return sumNumbers