Skip to content

Instantly share code, notes, and snippets.

@sukima
sukima / index.html
Created November 22, 2014 21:04
Using Browserify better. Scalable.
<html>
<body>
<script type="javascript">
var ModuleA = require('main').ModuleA;
var ModuleB = require('main').ModuleB;
</script>
</body>
</html>
$ sudo strace -p 12345 # PhantomJS process
------------------------ >8 ------------------------
gettimeofday({1432851328, 127899}, NULL) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f5fdae3c000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f5fdae3a000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f5f955c1000
munmap(0x7f5f6efca000, 4096) = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f5f86d08000
munmap(0x7f5f955c1000, 8192) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f5f955c1000

PromiseProxyMixin

The official documentation: http://emberjs.com/api/classes/Ember.PromiseProxyMixin.html

Learned Caveats

  • The promise property is a computed value and cannot be overwriten.
  • The computed properties managed by the promise only ever trigger if you this.set('promise', ...).
  • The resolved value of the promise will become the value of content (and same for reason when rejected).
  • If the promise attaches a .then() which reurns the value of a this.set() it will cause an infinite loop and never resolve.

A Patch based commenting system for static blogs

This is a Request For Comment on a workflow solution to allow readers of a static site blog to post comments.

Problem domain

A recent trend for blog owners (especially technical blogs) is to use static site generators. These frameworks allow the blog owner to author blog posts in a

Snippit from Security Now Podcast: https://www.grc.com/sn/sn-444.htm


Steve: Oh, yeah, there it is. So I had seen it visually, but I'd never dug into it and looked at it. But so many people were tweeting me that I got tired of saying go look at Threema. I thought, okay, let's go look at Telegram. So I go to the website, and I'm impressed by the openness of what I see. I mean, they appear to be good people. Everything is open, open source. They're multiplatform. There on the screen you are showing their API. There's a bunch of different stuff going on. They're running competitions. They're like, who can create the best Telegram Android app and so forth. So all that seems good.

So then, of course, I want to go find out about the crypto. And I see this diagram that is the most bizarre-looking thing I have ever encountered. I mean, I don't think I'm exaggerating. Maybe it's the most bizarre thing I've ever encountered. And I look at it, and they're like, they're taking the plaintext of the message, and the

ratingText = {
singular: {
"Closed": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
"Archived": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
default: L("1_person_wants_this_fixed", "1 person wants this fixed")
},
plural: {
"Closed": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"),
"Archived": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"),
default: L("people_want_this_fixed", "%s people want this fixed")
def missing(message)
if message.is_a? Symbol
puts "The environment is missing #{message.to_s.upcase}"
else
puts message
end
end
desc "Check the environment for proper setup"
task :checkenv do
@danbernier
danbernier / Rakefile
Created April 18, 2013 20:16 — forked from sukima/Rakefile
def missing(message)
if message.is_a? Symbol
puts "The environment is missing #{message.to_s.upcase}"
else
puts message
end
end
desc "Check the environment for proper setup"
task :checkenv do
@danbernier
danbernier / gist:5395929
Created April 16, 2013 13:34
Getting back undefined
(function(undefined) {
// In here, undefined is back to normal,
// because we passed the function no params!
})();