This file contains 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
#import('dart:html'); | |
class SVGSamples { | |
void run() { | |
drawlines(); | |
} | |
void drawlines() { | |
final int maxY = 250; |
This file contains 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
#import('dart:io'); | |
final String PATH_TO_DARTSDK = "/Users/XYZ/dart-sdk"; | |
final String SUBDIRECTORY = ""; | |
final String LIBRARY_DARTFILE = "XYZ.dart"; | |
This file contains 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
class MyClass{ | |
static MyClass _ref; | |
static MyClass get context() => _ref == null ? new MyClass() : _ref; | |
factory MyClass(){ | |
if (_ref != null) return _ref; | |
_ref = new MyClass._internal(); | |
This file contains 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
class FileHandler { | |
FileHandler(){ | |
} | |
void onRequest(HttpRequest request, HttpResponse response, [String fileName = null]){ | |
final int BUFFER_SIZE = 4096; | |
if (fileName == null) { | |
fileName = request.path.substring(1); | |
} |
This file contains 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
class NotFoundHandler { | |
NotFoundHandler(){ | |
} | |
List<int> _notFoundPage; | |
static final String notFoundPageHtml = """ | |
<html><head> | |
<title>404 Not Found</title> | |
</head><body> | |
<h1>Not Found</h1> | |
<p>The requested URL was not found on this server.</p> |
This file contains 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
#import('dart:core'); | |
class FannkuchreduxTest { | |
static int fannkuchredux(int n) { | |
var perm = new List(n); | |
var perm1 = new List(n); | |
var count = new List(n); | |
int maxFlipsCount = 0; | |
int permCount = 0; |
This file contains 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
require 'cgi' | |
require 'digest/md5' | |
require 'net/https' | |
require 'uri' | |
module Jekyll | |
class GistTag < Liquid::Tag | |
def initialize(tag_name, text, token) | |
super | |
@text = text |
This file contains 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
import java.util.Comparator; | |
import java.util.PriorityQueue; | |
import java.util.Queue; | |
// Given a stream of unsorted integers, find the median element in sorted order at any given time. | |
// http://www.ardendertat.com/2011/11/03/programming-interview-questions-13-median-of-integer-stream/ | |
public class MedianOfIntegerStream { | |
public Queue<Integer> minHeap; | |
public Queue<Integer> maxHeap; |
This file contains 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 MIME; | |
// get MIME type (returns null if there is no such extension) | |
String mimeType(String extension) => _mimeMaps[extension]; | |
// default MIME type mappings | |
Map _mimeMaps = const { | |
'abs': 'audio/x-mpeg', | |
'ai': 'application/postscript', | |
'aif': 'audio/x-aiff', |
This file contains 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
/* | |
* Deployes dart packages. | |
* | |
* Takes the dart packages in directory | |
* /source/dir/packages/... | |
* which is configured in the configuration files build.json, | |
* i.e. | |
* {"packages-dir": "/source/dir(packages"} | |
* | |
* and copies them to the directory |
OlderNewer