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
# ------------------------------------------------------------------------ | |
# 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) | |
# ------------------------------------------------------------------------ |
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
// 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 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 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 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 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 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 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
/* | |
Copyright 2020 Anthony Hawkes | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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 script first clears the CRL cache in the event a proxy CA, internal CA, scanning tool CA or AV CA gets trusted for | |
# something it shouldn't and your mac won't accept the genuine certificate. | |
# After clearing the CRL cache this script shreds the App Store caches - probably restart after and try downloading from the | |
# App Store again. | |
# If it doesn't fix your problem.... well good luck, may Google be by your side. | |
# Clear crl and oscp cache | |
sudo rm /var/db/crls/*.db |
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
# One liner. The input file should contain one entry per line. | |
# `grep -i -E '(OrgName|Country)'` can be removed to show all of the whois output or modified to select preferred items. | |
cat lookupips.txt | while read ip; do echo $ip; whois -H $ip | grep -i -E '(OrgName|Country)'; done | |
# Same but includes a ptr lookup - change 1.1.1.1 to whichever server you want to use or remove to use your local server. | |
cat lookupips.txt | while read ip; do echo $ip; nslookup $ip 1.1.1.1 | grep -o -E 'name = .*$'; whois -H $ip | grep -i -E '(OrgName|Country)'; done |
OlderNewer