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
================================================================================ | |
Model prompt >>> Prime Minister Juha Sipilä's offer for the government to resign | |
was accepted by President of Finland Sauli Niinistö on Friday. President | |
Niinistö asked the cabinet to complete its term in office in an administrative | |
capacity. ======================================== SAMPLE 1 ======================================== | |
The President asked that the government and parliament resign and called on the | |
president to resign. | |
The situation was also resolved after the cabinet refused to meet for three days |
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
let dataLayerHistory = [] | |
// this would come from GA | |
let dataLayer = { | |
push(obj) { | |
console.log("pushed to dataLayer", obj) | |
} | |
} | |
// here's our clever little trick... |
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
(function() { var names = document.querySelectorAll("td.name"); console.log(names[Math.floor(Math.random() * names.length)].innerText) })(); |
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
const constrain = ({ pre = () => {}, post = () => {} }) => fn => (...args) => { | |
const throwIf = x => y => { if (x(y)) { throw x(y) } else return y }, | |
compose = (...args) => args.reduce((x,fn) => (...args) => fn(x.apply(x, args))) | |
return compose(throwIf(pre), fn.bind(fn, args), throwIf((...a) => post.apply(a.concat(args)))).apply(null, args) | |
} | |
const sqrt = constrain( | |
{pre: x => x < 0 && "Let's go shopping!", | |
post: (y, x) => y < 0 && "Math is hard." | |
|| 0.1 < y*y - x && "Floats are harder.", |
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
1. Enter "sudo scutil" and press Return | |
2. Type "list". Look for a key like "State:/Network/Service/com.viscosityvpn.vpn-tun0/DNS" | |
3. Enter "remove <key" (e.g. " remove State:/Network/Service/com.viscosityvpn.vpn-tun0/DNS") | |
4. Enter "quit" |
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
cluster = require 'cluster' | |
settings = require './settings' | |
log4js = require 'log4js' | |
port = process.env.PORT || 3000 | |
forks = settings.forks || 1 | |
newrelic = | |
noticeError: (error) -> | |
if (settings.newrelic_license) | |
newrelic = require 'newrelic' |
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
.directive 'my-magix-directivix', ['$compile', ($compile) -> | |
compile: (element, attrs) -> | |
element.attr("my-other-directive", "and-some-settings") | |
element.attr("ng-model", "foobar") | |
element.removeAttr("my-magix-directivix") | |
element.removeAttr("data-my-magix-directivix") | |
{ | |
pre: -> | |
post: ($scope, element) -> | |
$compile(element)($scope) |
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
(function() { | |
return | |
"a" | |
})() | |
>>> undefined | |
(function() { | |
return "a" | |
})() |
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
public String getDays() { | |
String ret = ""; | |
for (int i = 0; i < days.size(); i++) { | |
if (i > 0) { | |
ret += ", "; | |
} | |
ret += days.get(i); | |
} | |
return ret; | |
} |
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
» curl -i -N -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: [hidden]" -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: hub.towtruck.mozillalabs.com" -H "Origin: https://towtruck.mozillalabs.com" http://hub.towtruck.mozillalabs.com/hub/[sessionId] | |
HTTP/1.1 101 Switching Protocols | |
Upgrade: websocket | |
Connection: Upgrade | |
Sec-WebSocket-Accept: [A token] | |
Origin: https://towtruck.mozillalabs.com | |
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1152,"offsetY":868,"clientId":"aKgBnNEpbn"} | |
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1103,"offsetY":766,"clientId":"aKgBnNEpbn"} |
NewerOlder