See Also:
| Level | Score | Regex | Credit |
|---|
| this.run = function() { | |
| var fixedheight = 0; | |
| if (this.openflag && this.nvdata.next) { | |
| var nvnexttop = document.body.scrollTop || document.documentElement.scrollTop; | |
| var dofixed = nvnexttop !== 0 && document.documentElement.clientHeight >= 15 && this.nvdata.next.getBoundingClientRect().top - this.nvdata.height < 0; | |
| if (dofixed) { | |
| if (this.nv.style.position != 'fixed') { | |
| this.nv.style.borderLeftWidth = '0'; | |
| this.nv.style.borderRightWidth = '0'; | |
| this.nv.style.height = this.nvdata.height + 'px'; |
| #!/bin/bash | |
| # Abort when curl fails | |
| set -e | |
| USERNAME= | |
| PASSWORD= | |
| echo -n "Force logging off: " | |
| curl 'https://net.zju.edu.cn/rad_online.php' -H 'Origin: https://net.zju.edu.cn' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: */*' -H 'Referer: https://net.zju.edu.cn/srun_port1.php?url=http://www.example.com/' --data "action=auto_dm&username=${USERNAME}&password=${PASSWORD}" >/dev/null 2>&1 | |
| echo "success!" |
| go to the 1st comment for the problem statement please. :) |
See Also:
| Level | Score | Regex | Credit |
|---|
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct closure { | |
| void (* call)(struct closure *); | |
| int x; | |
| }; |
| :javascript | |
| $(document).ready(function() { | |
| window.loadIngredientSuggestionsEditor(#{@ingredients}); | |
| }); | |
| %h1 Edit ingredient suggestions | |
| #js-ingredient-suggestions-editor |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| diff --git gdk/quartz/gdkscreen-quartz.c gdk/quartz/gdkscreen-quartz.c | |
| index eafaf20..1cf98e2 100644 | |
| --- gdk/quartz/gdkscreen-quartz.c | |
| +++ gdk/quartz/gdkscreen-quartz.c | |
| @@ -75,8 +75,17 @@ gdk_quartz_screen_init (GdkQuartzScreen *quartz_screen) | |
| NSScreen *nsscreen; | |
| nsscreen = [[NSScreen screens] objectAtIndex:0]; | |
| - gdk_screen_set_resolution (screen, | |
| - 72.0 * [nsscreen userSpaceScaleFactor]); |
| body{ | |
| background:#1a1a1a; | |
| color:#ddd | |
| } | |
| .comment .usertext .md p>a:visited,.md a,.res.res-nightmode .tagline a,a,h2 a:visited{ | |
| color:#3498db; | |
| -webkit-transition:color .15s ease-in-out; | |
| -moz-transition:color .15s ease-in-out; | |
| -o-transition:color .15s ease-in-out; |