This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION nomenklatura (key text, dataset text, api_key text) | |
| RETURNS text | |
| AS $$ | |
| import json, urllib, urllib2 | |
| url = 'http://nomenklatura.okfnlabs.org/%s/lookup?' % dataset | |
| url += urllib.urlencode({'api_key': api_key, 'key': key}) | |
| req = urllib2.Request(url, None, {'Accept': 'application/json'}) | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dayLength = 24 * 60 * 60 * 1000 | |
| beforeMidnight = (dayLength - 1) | |
| endDate = (year, month, day) -> | |
| date = new Date(year, parseInt(month or 1)-1, day or 1) | |
| return new Date(date.getTime() + beforeMidnight) | |
| exports.parseDate = (dateString) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(emoGG) | |
| source("imgcat.R") | |
| p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_emoji(emoji="1f337") | |
| imgcat(print(p)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import argv | |
| from shapely.ops import polygonize | |
| from shapely.geometry import asShape, LineString | |
| import json | |
| if __name__ == '__main__': | |
| input = argv[1] | |
| input = json.load(open(input)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Important: You must serve your pages as XHTML for this shim to work, | |
| // otherwise namespaced attributes and elements will get messed up. | |
| Object.defineProperty(SVGElement.prototype, 'innerHTML', { | |
| get: function() { | |
| var $child, $node, $temp, _i, _len, _ref; | |
| $temp = document.createElement('div'); | |
| $node = this.cloneNode(true); | |
| _ref = $node.children; | |
| for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
| $child = _ref[_i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| // Support for AJAX loaded modal window. | |
| // Focuses on first input textbox after it loads the window. | |
| $('[data-toggle="modal"]').click(function(e) { | |
| e.preventDefault(); | |
| var url = $(this).attr('href'); | |
| if (url.indexOf('#') == 0) { | |
| $(url).modal('open'); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DELIM = ',' | |
| const QUOTE = '"' | |
| const MAX_LENGTH = 9 | |
| const tokenRainbow = state => `string num${state.num}` | |
| const tokenPlain = () => 'string' | |
| CodeMirror.defineMode('csv', function modeCsv(opts, modeOpts) { | |
| let { delimiter = DELIM, rainbow = false } = modeOpts | |
| let token = rainbow ? tokenRainbow : tokenPlain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Usage for a custom post type named 'movies': | |
| * unregister_post_type( 'movies' ); | |
| * | |
| * Usage for the built in 'post' post type: | |
| * unregister_post_type( 'post', 'edit.php' ); | |
| */ | |
| function unregister_post_type( $post_type, $slug = '' ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requirement! install imagemagick | |
| # brew install imagemagick | |
| # or build from source here http://www.imagemagick.org/script/binary-releases.php | |
| #navigate to folder of the images | |
| cd folderofmyimages/ | |
| # take every jpg in the folder and smash into a gif with a frame rate of 0.5 sec | |
| convert -delay 50 *.jpg gif_of_my_images.gif |
OlderNewer