Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈
http://raf.hns.to/

@racascou rafaelcastrocouto

🏳️‍🌈
http://raf.hns.to/
View GitHub Profile
@gaearon
gaearon / Classes.js
Created May 27, 2020
Beneath Classes: Prototypes
View Classes.js
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();
@slavaceornea
slavaceornea / NewYearChaos.java
Created Jul 17, 2016
This java class solves the NewYearChaos problem. Check out code comments for description of problem and solution.
View NewYearChaos.java
package newyearchaos;
import java.util.Scanner;
/**
*
* @author Slava
*
* It's New Year's Day and everyone's in line for the Wonderland rollercoaster ride!
*
@balupton
balupton / cors.js
Created Sep 11, 2012
Acheiving CORS via a Node HTTP Server
View cors.js
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);