Skip to content

Instantly share code, notes, and snippets.

View matanlurey's full-sized avatar

Matan Lurey matanlurey

View GitHub Profile
@matanlurey
matanlurey / readapurge.py
Created August 5, 2011 22:17
Readability Bookmark Purge
'''
Readability Bookmark Purge
===
DELETES All of your *ARCHIVED* Bookmarks
Useful for Starting 'Fresh'
You need to install the Readabiliy Python Library
http://pypi.python.org/pypi/readability-api/#downloads
By Matan Lurey (matan [at] lurey [dot] org)
using System;
using System.Security.Cryptography;
using System.Text;
namespace Com.Rakuten.Services.Common.Secure
{
/// <summary>
/// Salted password hashing with PBKDF2-SHA1
/// </summary>
/// <remarks>
using System;
using System.Security.Cryptography;
using System.Text;
namespace Com.Rakuten.Services.Common.Secure
{
/// <summary>
/// Salted password hashing with PBKDF2-SHA1
/// </summary>
/// <remarks>
@matanlurey
matanlurey / index.html
Created May 10, 2014 02:39
The beginning of our Angular.dart application, Work Manager.
<!DOCTYPE html>
<html ng-app>
<head>
<title>Work Manager</title>
</head>
<body>
<script type="application/dart" src="lib/index.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
@matanlurey
matanlurey / main.dart
Created June 9, 2014 16:40
Bug: Static Methods in Dart
void main() {
// No error:
User.doSomething();
// Error
User
..doSomething()
..doSomething();
}
library reflection_test;
import 'dart:mirrors';
List someFunction(String string, List list, Map map) {}
void main() {
ClosureMirror mirror = reflect(someFunction);
// Outputs: (String, List, Map)
@matanlurey
matanlurey / ng_await_usage.html
Created October 5, 2016 14:46
Example of a *ngAwait directive and use.
<!--
Assume we have the following Dart code:
Future<String> onName => _nameService.getName();
-->
<!-- Default case: On future complete, load data as $value -->
<template [ngAwaitThen]="onName">
Hello {{$value}}!
</template>
@matanlurey
matanlurey / angular_linter_plugin.dart
Created October 17, 2016 00:53
A strawman for an extensible Linter API
import 'dart:async';
import 'package:angular2/metadata.dart';
import 'package:linter/isolate.dart';
Future<Null> main(SendPort sendPort) {
// Create a new 'Isolate'-based plugin to the linter.
final plugin = await registerPlugin(sendPort, new PluginOptions(
// To avoid serializing/deserializing needlessly, support a basic
// regular expression-based filter to check a file for before
@matanlurey
matanlurey / fetch_contacts.dart
Last active February 22, 2017 20:15
An example of a JavaScript library that fetches your contacts from an "API".
@JS()
library fetch_contacts_interop;
import 'package:func/func.dart';
import 'package:js/js.dart';
// Natively calls "fetch_contacts", but we can use typed Dart code while developing!
@JS('fetch_contacts')
external void fetchContacts(String prefix, VoidFunc1<List<String>> callback);
@matanlurey
matanlurey / fetch_contacts_v2.dart
Created February 22, 2017 20:19
Using the `Completer` API in Dart to make a JavaScript API more Dart idiomatic
@JS()
library fetch_contacts_interop;
import 'dart:async';
import 'package:func/func.dart';
import 'package:js/js.dart';
// Natively calls "fetch_contacts", but we can use typed Dart code while developing!
@JS('fetch_contacts')