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
| Mongolian = require('mongolian') | |
| ObjectId = Mongolian.ObjectId | |
| Server = require('./server') | |
| Service = require('./service') | |
| {log, log2, loge} = require('./util') | |
| class ResourcesServer extends Server | |
| constructor: (@app) -> | |
| @service = new ResourcesService(@app) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>fileTypes</key> | |
| <array> | |
| <string>mdown</string> | |
| <string>markdown</string> | |
| <string>markdn</string> | |
| <string>md</string> |
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
| int main(int argc, const char * argv[]) | |
| { | |
| @autoreleasepool { | |
| if (argc == 1) { | |
| return 1; | |
| } | |
| NSString *word = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding]; | |
| CFStringRef result = DCSCopyTextDefinition(nil, (__bridge CFStringRef)word, CFRangeMake(0, word.length)); |
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
| tell application "Google Chrome" | |
| reload of active tab of window 1 | |
| end tell |
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
| var fs = require('fs'); | |
| var gunzip = require('gzbz2/bunzipstream'); | |
| var XmlStream = require('xml-stream'); | |
| var stream = gunzip.wrap('./enwiki-20121101-pages-articles.xml.bz2', {}); | |
| var xml = new XmlStream(stream); | |
| var countPages = 1; | |
| xml.on('text: page > title', function(el) { | |
| console.log(el.$text); |
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 instance of cleaner | |
| cleaner = Cleaner() | |
| cleaner.table = 'articles' | |
| # Remove leading and trailing whitespace from column 'content' | |
| trim = TrimTransformer() | |
| cleaner.transform_field('content', trim) | |
| # From column 'content', derive word count and store result into column 'word_count' | |
| count = CountDeriver('word_count') |
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
| # encoding: utf-8 | |
| require "parslet" | |
| require "pp" | |
| require "ap" | |
| require "colored" | |
| program = "q0, (¢,Z,Z), (¢,B,B), q0, (R,-,-) | |
| // Ak pride a, striedavo uklada a raz na 1. raz na 2. zasobnik. |
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
| # encoding: utf-8 | |
| # Alan | |
| # Two-stack Turing machine simulator | |
| # | |
| # Author: Vojtech Rinik <[email protected]> | |
| # License: MIT | |
| # Example program: |
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 anywhere | |
| NKDrawGradientWithHexColors(c, drawingRect, @"f0eef1", @"fbfbfc"); | |
| NKDrawBorder(c, drawingRect, NKBorderBottom, 1, @"red"); | |
| // From NSView | |
| - (void)style { | |
| [self drawGradientStartColor:@"f0eef1" endColor:@"fbfbfc"]; | |
| [self drawBorder:NKBorderBottom lineWidth:1 color:@"red"]; | |
| } |
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
| @interface NKStyle : NSObject | |
| @property (assign) CGRect frame; | |
| - (id)initWithFrame:(CGRect)frame; | |
| // Background | |
| @property (nonatomic, strong) NKColor *backgroundColor; | |
| // Border | |
| @property (assign) CGFloat borderRadius; |