An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| # nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite | |
| # copyright (c) 2012 darkf | |
| # licensed under the WTFPL (WTF Public License) | |
| # see http://sam.zoy.org/wtfpl/ for details | |
| from bottle import get, request, run | |
| import sqlite3, random, string | |
| con = sqlite3.connect('short.db') | |
| c = con.cursor() |
| stack = [] | |
| compileStacks = [] | |
| words = {} | |
| builtins = {} | |
| lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason | |
| def prn(o): | |
| print(o) | |
| def clr(l): |
| import sys | |
| t={} | |
| def w(o): | |
| c=t | |
| for l in o: | |
| c[l]=c[l]if l in c else{} | |
| c=c[l] | |
| c[None]=None | |
| g=lambda t,b,i:reduce(lambda i,l:i+[b]if l is None else g(t[l],b+l,i),t,i) | |
| map(w,open(sys.argv[1]).read().split("\n")) |
| <?php | |
| // Full disclosure: I wrote this while writing a Twitter Bootstrap enabled site, so the class tags are Twitter bootstrap enabled. Shouldn't be hard to style, though. | |
| $subReddit = "webdev"; // Enter the subreddit name here with no /r/ in front | |
| $selfTextLimit = 250; // Character limit for self text entries | |
| $pageData = json_decode( file_get_contents( "http://www.reddit.com/r/$subReddit/.json" ) ); | |
| foreach( $pageData->data->children as $post ): ?> |
| #!/bin/bash | |
| # | |
| # Binary search tree is of the form: | |
| # 10 | |
| # / \ | |
| # / \ | |
| # 4 16 | |
| # / \ / | |
| # 1 7 12 | |
| # |
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
| data:text/html;charset=utf-8, <title>TextEditor</title> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style> html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size: 100% 20p |
| /* | |
| <a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
| - Or, request confirmation in the process - | |
| <a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
| */ | |
| (function() { |
| #!/bin/bash | |
| # This deploy hook gets executed after dependencies are resolved and the | |
| # build hook has been run but before the application has been started back | |
| # up again. This script gets executed directly, so it could be python, php, | |
| # ruby, etc. | |
| export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer" | |
| if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then | |
| curl -s https://getcomposer.org/installer | /usr/local/zend/bin/php -- --install-dir=$OPENSHIFT_DATA_DIR |