Skip to content

Instantly share code, notes, and snippets.

View breck7's full-sized avatar

Breck Yunits breck7

View GitHub Profile
<?php
/*
easier way to deal with $_POST & $_GET etc: typecast it to an object.
$post = (object)$_POST;
benefits:
- quicker to type (30% faster to type $post->username than to type $_POST['username'])
- reduces chance of making syntax mistakes(you have to make sure to match 2 sets of tokens( ' and [ )in the former and 0 in the latter, reducing the likelihood of annoying syntax mistakes.
$isBot = preg_match('/(spider|crawl|curl|python|twitt|bot|google|perl|archiver|monitor|mechanize)/i',$_SERVER['HTTP_USER_AGENT']);
<?php
function post($url, $post_array)
{
// curl
}
?>
@breck7
breck7 / wcd
Created February 1, 2010 17:06
#!/bin/bash
echo $1
newpath=$(echo $1 | sed 's|\\|/|g' | sed 's|:||g' | sed 's|^C|/cygdrive/c|')
echo $newpath
cd "$newpath"
@breck7
breck7 / mindmap.space
Last active December 17, 2015 01:39
Mind map for NudgePad
title
tag title
content Mindmap
block2
style
left 370px
top 181px
width auto
padding 15px
height auto
@breck7
breck7 / mday
Last active December 17, 2015 03:18
mothers day draft 1
title
tag title
content Coming Soon
stylesheet
tag link
rel stylesheet
href site.css
container
style
position absolute
@breck7
breck7 / blog.space
Last active December 17, 2015 03:49
simple blog template for nudgepad
title
tag title
content {{post.title Post Title}}
stylesheet
tag link
rel stylesheet
href site.css
container
style
width 90%
@breck7
breck7 / piano.space
Last active December 17, 2015 05:29
Piano demo in NudgePad.
iosViewport
content <meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />
title
tag title
content Coming Soon
stylesheet
tag link
rel stylesheet
href site.css
dancerCode
@breck7
breck7 / gist:e043fc3c0572c6d97154
Created January 18, 2015 00:28
package.space
name space
version 0.8.7
description A lightweight language for objects
main ./space.js
bin
space cli.js
scripts
test node tests/node-test.js
repository
type git
> Please don't mistake this question as offensive, but: How many people did you show this to before putting it out in the open?
Not offended at all! I showed the paper to somewhere between 20 - 30 people before putting it out there. The paper improved 100x thanks entirely to them,
but still, the response was lukewarm(at best). I only have a B.S. in Economics (and barely at that), and have never written
a "paper" before, so that might explain some of its "quirks".
> The biggest problem of the whole thing is that it doesn't even get its motivation across to me. I read through the blogpost and the paper and I have no idea why I should care.
Haha, great point! For many years I've been wrestling with a few core problems:
- visual programming