github page 2 - Dave's Blog

Search
My timeline on Mastodon

Unicode Clock

2016 Jan 24, 2:00

I've made a Unicode Clock in JavaScript.

Unicode has code points for all 30 minute increments of clock faces. This is a simple project to display the one closest to the current time written in JavaScript.

Because the code points are all above 0xFFFF, I make use of some ES6 additions. I use the \u{XXXXXX} style escape sequence since the old style JavaScript escape sequence \uXXXX only supports code points up to 0xFFFF. I also use the method String.codePointAt rather than String.charCodeAt because the code points larger than 0xFFFF are represented in JavaScript strings using surrogate pairs and charCodeAt gives the surrogate value rather than codePointAt which gives the code point represented by the pair of surrogates.

"πŸ•›".codePointAt(0)
128347
"πŸ•›".charCodeAt(0)
55357

πŸ•πŸ•‘πŸ•’πŸ•“πŸ•”πŸ••πŸ•–πŸ•—πŸ•˜πŸ•™πŸ•šπŸ•›πŸ•œπŸ•πŸ•žπŸ•ŸπŸ• πŸ•‘πŸ•’πŸ•£πŸ•€πŸ•₯πŸ•¦πŸ•§

The ordering of the code points does not make it simple to do this. I initially guessed the first code point in the range would be 12:00 followed by 12:30, 1:00 and so on. But actually 1:00 is first followed by all the on the hour times then all the half hour times.

PermalinkCommentsjavascript Unicode

JavaScript Types and WinRT Types

2016 Jan 21, 5:35PermalinkCommentschakra development javascript winrt

Retweet of codepo8

2015 Nov 3, 8:33
Github's to blame! pic.twitter.com/ZOEvCeiCux
PermalinkComments

Tweet from David_Risney

2015 Aug 14, 2:20
CreateRemoteThread is much easier to use to crash a remote process than its intended purpose: https://github.com/david-risney/CrashProcess/blob/master/CrashProcess/CrashProcess.cpp β€¦
PermalinkComments

Tweet from David_Risney

2015 Apr 12, 10:27
GitHub has spoiled me. We need a pull-request HTTP method and then you can just fix it for them. https://twitter.com/ericlaw/status/587614039645143040 β€¦
PermalinkComments

Tweet from David_Risney

2015 Apr 9, 11:21
CSS to render Markdown as unrendered Markdown https://gist.github.com/ImJasonH/c00cdd7aece6945fb8ea β€¦
PermalinkComments

Retweet of newsycombinator

2015 Apr 9, 4:34
Show HN: Bot accepts every pull request for its own code https://github.com/botwillacceptanything/botwillacceptanything β€¦
PermalinkComments

Retweet of ericlaw

2015 Apr 2, 12:23
Nice writeup of the attack on GitHub: http://blog.erratasec.com/2015/04/pin-pointing-chinas-attack-against.html#.VRye4mK9KK0 β€¦
PermalinkComments

Tweet from David_Risney

2015 Mar 30, 10:52
Or from GitHub's POV, how else can you use this XSS? Example: Open a new window with info on howto subvert particular censorship. What else?
PermalinkComments

Tweet from David_Risney

2015 Mar 30, 10:20
More GitHub DDoS details: http://www.netresec.com/?page=Blog&month=2015-03&post=China%27s-Man-on-the-Side-Attack-on-GitHub β€¦ Wouldn't it be safer for attacker to load DDoS victim's content via img than script tag?
PermalinkComments

Tweet from David_Risney

2015 Mar 29, 11:01
Faust: I want to XSS everyone! Devil: Sign here… Faust: Oh no, GitHub server's can't handle the traffic! β™ͺ Twilight zone theme β™ͺ
PermalinkComments

Tweet from David_Risney

2015 Mar 29, 10:53
Any more technical details on the GitHub DDOS beyond this http://insight-labs.org/?p=1682  for the curious?
PermalinkComments

Tweet from David_Risney

2015 Mar 8, 6:11
Bi-monthly reminder that neither of JavaScript's equality operators (== and ===) are reflexive. http://dorey.github.io/JavaScript-Equality-Table/ β€¦
PermalinkComments

Retweet of annevk

2015 Mar 6, 8:02
Yay, thanks to @mastahyeti GitHub Pages now includes `Access-Control-Allow-Origin: *`! Which is totally safe: https://annevankesteren.nl/2012/12/cors-101 β€¦
PermalinkComments

Retweet of getify

2015 Feb 24, 6:25
Lots of questions about my #ES6 arrow functions assertions. Here's full context (and some cleanup/clarifications): https://github.com/getify/You-Dont-Know-JS/blob/master/es6%20%26%20beyond/ch2.md#arrow-functions β€¦
PermalinkComments

Tweet from David_Risney

2015 Feb 1, 9:38
Custom named operators in C++ https://github.com/klmr/named-operator β€¦ This is some kind of hack! Depends solely on operator overloading.
PermalinkComments

David_Risney: Just put up CSP Fiddler extension to help figure out minimum required CSP rules for web pages.

2015 Jan 24, 5:32
David Risney @David_Risney :
Just put up CSP Fiddler extension https://github.com/david-risney/CSP-Fiddler-Extension β€¦ to help figure out minimum required CSP rules for web pages.
PermalinkComments

jacobrossi: "I'm going to push this change to github" responds with: /via

2015 Jan 23, 2:35
Jacob Rossi @jacobrossi :
"I'm going to push this change to github" @somelaniesaid responds with: https://www.youtube.com/watch?v=pE0_GaLsX1Y β€¦ /via
PermalinkComments

jacobrossi: now uses HSTS, which "coincidentally" is in EdgeHTML engine rolling out to the tech preview

2015 Jan 22, 11:45
Jacob Rossi @jacobrossi :
http://status.modern.IE  now uses HSTS, which "coincidentally" is in EdgeHTML engine rolling out to the tech preview https://github.com/InternetExplorer/Status.IE/commit/31297bc1c8aaf43b4459d49764b5a865b5f66223 β€¦
PermalinkComments

JS NICE: Statistical renaming, Type inference and Deobfuscation

2014 Jun 3, 9:36

JS NICE | Software Reliability Lab in ETH

JS NICE has indexed over 10,000 JavaScript projects from GitHub and then probabilistically infers newly suggested names and types for all of the local variables and function parameters of new JS.

PermalinkCommentstechnical javascript js coding
Older EntriesNewer Entries Creative Commons License Some rights reserved.