Skip to content

Instantly share code, notes, and snippets.

View endocrimes's full-sized avatar

Danielle endocrimes

View GitHub Profile
@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
#include <stdio.h>
enum RightsFlags {
user = 2,
moderator = 4,
admin = 8
};
int hasFlag(int haystack, int needle) {
return (haystack & needle) == needle;
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

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.

<?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();
<script type="text/javascript">
(function () {
var Tickr = {
run: function (opts) {
var el = opts.el;
if(!el) return;
var start = Date.now(), delta;
var target = opts.target;
var duration = opts.duration;
var outputType = (el.nodeName.toLowerCase() === 'input') ? 'value' : 'innerHTML';
@endocrimes
endocrimes / responsive.html
Created December 11, 2012 19:32 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@endocrimes
endocrimes / robot.js
Created December 3, 2012 17:17
ROBOMOTO
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@endocrimes
endocrimes / flare.json
Created November 27, 2012 17:28
Craig Reville New D3 JSON Format Force Graph with Pan And Zoom
[
{
"name": "Hotel Amfora",
"cluster": 4,
"supplier": "ADRIATICA",
"size": 24.61060620890301
},
{
"name": "Hotel Sol Garden Istra",
"cluster": 4,
@endocrimes
endocrimes / Index.html
Created November 25, 2012 21:15
Clustered Force Layout + Custom Gravity with Pan & Zoom, importing a Json file & Canvas boundaries
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Data-Driven Documents</title>
<link rel="stylesheet" href="main.css">
<script src="http://d3js.org/d3.v3.min.js"></script>