Skip to content

Instantly share code, notes, and snippets.

gifguide2code

Block or report user

Report or block gifguide2code

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gifguide2code
gifguide2code / JSON2CSV-Google_Location_History.py
Created Mar 24, 2019
Converts a Google Location JSON file into a CSV with Timestamp, Latitude, and Longitude.
View JSON2CSV-Google_Location_History.py
import re
import json
import csv
JSON_data="C:/Users/JSON FILE PATH.txt"
CSV_file="C:/Users/CSV FILE PATH.csv"
with open(JSON_data) as f:
data = json.load(f)
csv_f=open(CSV_file, 'w')
@gifguide2code
gifguide2code / csvParser.py
Created Jan 5, 2019
A Python script that will return the number of rows and columns in a spreadsheet, list out the headers, and prompt the user for two columns to extract into a new csv file.
View csvParser.py
import csv
CSVfile = 'C:/Users/The CSV to Parse'
condCSVpath = 'C:/Users/The New CSV to Save'
#the .reader function returns a parsed list of rows
#Function counts number of rows
def HowManyRows(fp):
f = open(fp, encoding='utf8')
csv_f = csv.reader(f)
@gifguide2code
gifguide2code / Colorify.gs
Created Aug 18, 2018
A script to randomize all the character colors in a Google Doc. Use with caution.
View Colorify.gs
function Multicolor() {
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
//This Loops Through All Paragraphs
for(var i=0; i<body.getNumChildren(); i++) {
var par = body.getChild(i);
//This Loops Through Paragraph Children
@gifguide2code
gifguide2code / Fade-In-Text.gs
Created Aug 13, 2018
A script for Google Docs, gently turning white text to black in the first paragraph of a document.
View Fade-In-Text.gs
function myFunction() {
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
var paragraph = body.getChild(0);
var txt = paragraph.asParagraph().getChild(0); //This returns the text in the first paragraph.
var len = txt.asText().getText().length; //This returns the number of characters in the first paragraph.
Logger.log(len);
var red = 250;
var green = 250;
@gifguide2code
gifguide2code / CraigslistScraper.py
Last active Aug 11, 2018
A Python script to scrape the Craigslist apartment listings into an Excel spreadsheet.
View CraigslistScraper.py
import requests
import bs4
import openpyxl
#Functions to remove empty spaces and make a dictionary of listing names/URLs
def strip(txt):
ret=""
for l in txt.split("\n"):
if l.strip()!='':
ret += l + "\n"
@gifguide2code
gifguide2code / Firefly.py
Created Jul 22, 2018
The code for an add-on that generates 100 spheres at random locations in a 20 x 20 space at the center of a Blender scene.
View Firefly.py
bl_info = {
"name": "Fireflies",
"author": "GifGuide2Code",
"version": (1,0,0),
"category": "Object",
}
import bpy
import random
@gifguide2code
gifguide2code / ImageDecoder
Created Jul 9, 2018
A Processing sketch to pull messages out of pngs encoded with the ImageEncoder at https://gist.github.com/gifguide2code/382e99ee16e9defdaa9185979c3242ae
View ImageDecoder
IntList numbers;
void setup () {
numbers = new IntList();
size(400, 317);
PImage Original = loadImage("Starry Night.jpg");
PImage Encoded = loadImage("Encoded.png");
Original.loadPixels();
Encoded.loadPixels();
for (int x=0; x<width;x++) {
for (int y=0;y<height;y++) {
@gifguide2code
gifguide2code / ImageEncoder
Created Jul 9, 2018
A Processing sketch to hide messages in images. It assigns letters to numbers which are then used to change the red values in a .png copy of the original.
View ImageEncoder
IntList numbers;
void setup () {
numbers = new IntList();
String abc = ". abcdefghijklmnopqrstuvwxyz";
String message = "there is a place where the sidewalk ends and before the street begins and there the grass grows soft and white and there the sun burns crimson bright and there the moon bird rests from his flight to cool in the peppermint wind";
int n = 0;
for (int i=0; i<message.length();i++) {
String letter = str(message.charAt(i));
numbers.append(abc.indexOf(letter));
@gifguide2code
gifguide2code / imageLoad.py
Created Jul 1, 2018
This Blender function will go through a folder, pull all the jpg's inside, and map them to planes in Blender along the Z axis.
View imageLoad.py
import bpy
import os
def imageLoad(imgpath):
z=0
files = os.listdir(imgpath)
#Get the names of the files in the provided folder
for x in range(len(files)):
imagename = files[x][0:20]
if files[x].endswith('.jpg'):
@gifguide2code
gifguide2code / Confetti.py
Created Jun 30, 2018
A Python function to create confetti in Blender, more specifically it'll create 100 small planes, assign those a new texture, and randomize their location. The confetti function takes three parameters--the first is the name of the material to be assigned, the next three are the RGB values for that material. The code below will generate yellow, g…
View Confetti.py
import bpy
import random
def confetti(MatCol,r,g,b):
bpy.ops.mesh.primitive_plane_add()
bpy.ops.transform.resize(value=(.1,.1,.1))
#Resize to fit the scene
bpy.data.objects['Plane'].name = MatCol
#Rename the planes as the 1st paramater above
mat_name = MatCol
You can’t perform that action at this time.