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
var canvas = document.getElementById('canvas'); | |
var image = canvas.toDataURL('image/png').replace('image/png', 'image/octet-stream'); | |
window.location.href = image; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
... | |
<dict> | |
<key>name</key> | |
<string>Entity.name.label</string> | |
<key>scope</key> | |
<string>entity.name.label</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#F8F8F8</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
require 'em-websocket' | |
require 'webrick' | |
EM.run { | |
@clients = [] | |
EM::WebSocket.start(:host => '0.0.0.0', :port => '3001') do |ws| | |
ws.onopen do |handshake| | |
@clients.push ws | |
end |
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
var WebSocketServer = require('ws').Server; | |
var wss = new WebSocketServer({ port: 8080 }); | |
wss.on('connection', function(ws) { | |
ws.on('message', function(message) { | |
wss.clients.forEach(function(client) { | |
client.send(message); | |
}); | |
}); | |
}); |
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
package main | |
import "github.com/gorilla/websocket" | |
type client struct { | |
socket *websocket.Conn | |
room *room | |
send chan []byte | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta http-equiv="refresh" content="0; url=http://example.com/"> | |
</head> | |
<body></body> | |
</html> |
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
mailto:?subject=Title&body=http%3A%2F%2Fexample.com | |
# tweet | |
https://twitter.com/share?text=Title&url=http%3A%2F%2Fexample.com | |
# share on Facebook | |
https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fexample.com |
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
#include <iostream> | |
#include "foo.h" | |
void Foo::print() { | |
std::cout << "foo\n"; | |
} | |
extern "C" void Foo_print() { | |
Foo t; |
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
#include <stdio.h> | |
typedef enum { | |
ZERO | |
} NUM; | |
int main(void) { | |
double a = -1.0; | |
NUM b = a; |