Skip to content

Instantly share code, notes, and snippets.

@z-------------
z------------- / nntp-config-3_4_15.json
Created April 3, 2015 09:56
My New New Tab Page settings
{"appIconSize":130,"apps":[{"icon":"/img/fb.png","url":"http://www.facebook.com"},{"icon":"/img/el.png","url":"https://ello.co/"},{"icon":"http://a1.mzstatic.com/us/r30/Purple3/v4/bc/88/c4/bc88c44d-9de7-28b4-e2ab-a51c072a1600/icon175x175.jpeg","url":"https://sc-racers.slack.com"},{"icon":"/img/ix.png","url":"https://inbox.google.com/"},{"icon":"/img/gd.png","url":"https://drive.google.com"},{"icon":"/img/yt.png","url":"http://www.youtube.com"},{"icon":"/img/yh.png","url":"http://www.yahoo.com"},{"icon":"/img/pk.png","url":"http://getpocket.com/a/queue/"},{"icon":"/img/tw.png","url":"https://twitter.com"},{"icon":"/img/gd.png","url":"https://drive.google.com"},{"icon":"/img/gk.png","url":"https://drive.google.com/keep"},{"icon":"/img/vg.png","url":"http://www.theverge.com"}],"autoClose":true,"bgBlur":false,"firstRun":false,"noAnimation":false,"recSiteCount":3,"showAllBookmarks":false,"showAppsDrawer":true,"showBookmarks":false,"showFB":true,"showFBNotif":true,"slotCount":6,"titleText":"","topSiteCount":0,"useF
import xml.etree.ElementTree as ET
def xml_modify(fname, attr, val):
tree = ET.parse(fname)
root = tree.getroot()
for child in root:
child.attrib[attr] = val
return(ET.tostring(root).decode("utf-8"))
'''
Array.prototype.append = function(arr){
return [].push.apply(this, arr);
};
var zpad = function(str, len){
if (typeof str !== "string") str = str.toString();
return (new Array(len + 1).join("0") + str).slice(- len);
};
/*
zpad("1", 4)
--> 0001
*/
During the project, I learned to use a lot of new software, for example using Brackets to write HTML, JavaScript and other code, using Python and Apache to add server-side functionality, and how to use various command line tools such as cp to copy files to a different directory, grep to search for text in text, curl to download data from a server, and sudo to run commands as the root user. I also learned how to effectively conduct research to improve my own work and how to efficiently communicate with my client through email to make sure that I’m on the right track.
Although I’m pretty happy with the product that I have produced, I think that it would be better - as somebody mentioned in their feedback - if I found a better way to retrieve the list of Facebook posts in order to show attached pictures. I could also have worked a bit more on the content management system to make it easier to use. It is currently slightly confusing to use but could be improved with some tweaks. These are things that I might imp
def rand_item(my_list):
return(my_list[round(random.random() * (len(my_list) - 1))])
'''
use it like so:
waffles_list = ["waffles", "are", "cool"]
random_word = rand_item(waffles_list)
(don't forget to import random)
._585- {
background-color: transparent;
border: 1px solid transparent;
}
._4w98._4w97, ._42ft._42fu {
display: none;
}
._586i {
var rolleyroll = function(duration){
var newStyleText = "@keyframes rolleyroll { from { transform: rotate(0) } to { transform: rotate(1turn) } }\n@-webkit-keyframes rolleyroll { from { -webkit-transform: rotate(0) } to { -webkit-transform: rotate(1turn) } }";
var newStyleElem = document.createElement("style");
newStyleElem.textContent = newStyleText;
document.head.appendChild(newStyleElem);
var elements = document.querySelectorAll("body, body *");
for (var i = 0; i < elements.length; i++) {
var styleString = "rolleyroll " + (duration || 5) + "s infinite linear";
elements[i].style.animation = styleString;
@z-------------
z------------- / _crawl.py
Last active August 29, 2015 14:13
ssh... it's a secret
#!/usr/bin/env python3
from urllib.request import Request, urlopen
import sys
import os
import json
class color:
PURPLE = "\033[95m"
CYAN = "\033[96m"
<section id="members">
<h2>Members</h2>
<p>These altruistic representatives of the student body are grouped into <strong>3 different factions</strong>. There are <strong>6 members</strong> in each of the democratically-elected cabinets and <strong>4 strategically-appointed inter-body liaisons</strong>.</p>
<ul class="module member-list"></ul>
</section>