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
<?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>nix</string> | |
</array> | |
<key>name</key> | |
<string>Nix</string> |
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
# [PackageDev] target_format: plist, ext: tmLanguage | |
# Made by [email protected] | |
# This grammar tries to be complete, but regex-based highlighters | |
# can't be full parsers. Therefore it's a bit looser than the Nix | |
# parser itself and some legal constructs will be marked as illegal. | |
# It seems to work fine for nixpkgs. | |
# Cute hacks: Check out the attrset-for-sure and friends definitions | |
--- | |
name: Nix | |
scopeName: source.nix |
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
# We have a function that loads some resource. It might get called multiple times by our application, for example a web server. | |
# We use a stored promise to serve as both a cache and a hook for multiple callers to get the same result | |
# JavaScript version at the bottom | |
Q = require 'q' | |
loadPromise = null | |
doLoad = -> | |
if not loadPromise | |
# get a fresh result | |
loadPromise = Q.delay(1000).then -> Date.now() | |
# after 1 second clear cache |
NewerOlder