Skip to content

Instantly share code, notes, and snippets.

View endocrimes's full-sized avatar

Danielle endocrimes

View GitHub Profile
<?php
header(‘Content-Type: application/json’);
$feed = new DOMDocument();
$feed->load(‘path/to/rss.rss’);
$json = array();
$json[‘title’] = $feed->getElementsByTagName(‘channel’)->item(0)->getElementsByTagName(‘title’)->item(0)->firstChild->nodeValue;
$json[‘description’] = $feed->getElementsByTagName(‘channel’)->item(0)->getElementsByTagName(‘description’)->item(0)->firstChild->nodeValue;
$json[‘link’] = $feed->getElementsByTagName(‘channel’)->item(0)->getElementsByTagName(‘link’)->item(0)->firstChild->nodeValue;
$items = $feed->getElementsByTagName(‘channel’)->item(0)->getElementsByTagName(‘item’);
$json[‘item’] = array();

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

License Agreement for Source Code provided by Daniel Tomlinson
This software is supplied to you by Daniel Tomlinson in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this software.
In consideration of your agreement to abide by the following terms, and subject to these terms, Daniel Tomlinson grants you a personal, non-exclusive license, to use, reproduce, modify and redistribute the software, with or without modifications, in source and/or binary forms; provided that if you redistribute the software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the software, and that in all cases attribution of Daniel Tomlinson as the original author of the source code shall be included in all such resulting software pro
#include <stdio.h>
enum RightsFlags {
user = 2,
moderator = 4,
admin = 8
};
int hasFlag(int haystack, int needle) {
return (haystack & needle) == needle;
@endocrimes
endocrimes / Screencapture timelapse bash
Created November 23, 2013 00:25
Screencapture timelapse bash
i=1;while [ 1 ];do screencapture -t jpg -x ~/Desktop/screencapture/$i.jpg; let i++;sleep 5; done
@endocrimes
endocrimes / StyleGuide.md
Last active August 29, 2015 13:55
Objective-C style guide

My Objective-C Style guide

This style guide outlines the coding conventions that I try to stick to when writing Objective-C. I'm posting it here mostly as a brain dump and easy reference for the future, and to formalise it a little more.

It's pretty similar to that of the NYTimes. This document is mostly a customised version of that, you should go check theirs out!

Useful Resources

If you're looking to see some of the reasons behind some choices, or for something I haven't covered, look at the sites below, Apples documentation is pretty great.

### Keybase proof
I hereby claim:
* I am DanielTomlinson on github.
* I am DanToml (https://keybase.io/DanToml) on keybase.
* I have a public key whose fingerprint is 45C5 0C27 226E 1713 C7BD 5189 A065 D094 7C49 2423
To claim this, I am signing this object:

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@endocrimes
endocrimes / Observables.swift
Created July 14, 2014 23:00
A simple implementation of Observables in Swift
struct Observable<T> {
typealias Observer = (send:(newValue: T) -> ())
var observers = Dictionary<String, Observer>()
var value: T {
didSet {
_notify()
}
@endocrimes
endocrimes / Makefile
Last active October 8, 2017 13:17
Golang Makefile Template
CIRCLE_BUILD_NUM ?= DEV
TAG = 0.0.$(CIRCLE_BUILD_NUM)-$(shell git rev-parse --short HEAD)
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFILES = $(shell find . -name '*.go' -not -path './vendor/*')