This file contains hidden or 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
fn main() { | |
// This function modifies the values passed in | |
// Takes in a Vec with types i32 as a reference & and mutable | |
fn addition(in_vec: &mut Vec<i32>) { | |
// We've already referenced in_vec so no need for & | |
for x in in_vec { | |
// We need to dereference using * | |
*x = *x + 10; | |
} |
This file contains hidden or 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
from Tkinter import * | |
from ttk import * | |
import urllib | |
import csv | |
import operator | |
from collections import OrderedDict | |
class Lotto(object): | |
def __init__(self, url='http://dev-spook/callcentre/jason/MondayLotto-05-01-2015-19-02.csv'): |
This file contains hidden or 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
class SomeClass(object): | |
def __init__(self, param1=False, param2=False): | |
self.param1 = param1 | |
self.param2 = param2 #set some variables you could pass in at instantiation eg a = SomeClass(param1=5, param2=6) | |
# Make some empty variables you plan to use later: | |
self.some_array = [] | |
self.some_dict = {} |
This file contains hidden or 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
#Hypothetical models.py | |
from django.db import models | |
class Something(models.Model): | |
name = models.CharField(max_length=40) | |
some_number = models.IntegerField(max_length=5) | |
#Now you would magically create the table(s) with `python manage.py makemigrations; python manage.py migrate` | |
#Hypothetical other file accessing the model |
This file contains hidden or 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 json | |
import urllib | |
from PIL import Image | |
import cStringIO | |
map_data = "https://static.mwomercs.com/data/cw/mapdata.json" | |
data = json.load(urllib.urlopen(map_data)) | |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
# ------------------------------------------------------------------------ | |
# Anthony Hawkes who totally ripped off junkfood by | |
# Tyler Cipriani who ripped off | |
# Totally ripped off Dallas theme | |
# Anthony Hawkes - Totally modified the code/variables and layour to make | |
# it more human readable and obvious/less of a fluster cuck. Seperation | |
# of interests and all that. | |
# Also made it more pythonated as it'as better(my opinion, but true) | |
# ------------------------------------------------------------------------ |
NewerOlder