var http = require('http') var fs = require('fs') http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}) res.end("hello world") }).listen(3000);
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
FROM debian:9 | |
# Nothing works if you don't do this first | |
RUN apt-get update && apt-get upgrade -y | |
# Set locale to US EN UTF8 | |
RUN apt-get install locales -y && \ | |
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen && \ | |
locale-gen en_US.UTF-8 |
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
from django.core.files.base import ContentFile | |
f = ContentFile(o.read(), name='pic.png') | |
response = signed_post(self.api_client, self.c, '/api/v1/user/register/', { | |
'social_id': 'twitter:123452', | |
'gender': 'f', | |
'email': '[email protected]', | |
'name': 'whatevs', | |
'location': 'New York', |
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
GameClient.prototype.buildToken = function (body) { | |
var dt = Math.round(new Date().getTime() * .001) | |
var line = this.identity + "." + dt | |
var data = line | |
if (body) { | |
data = line + "." + body.trim() | |
} |
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
trait Similarity { | |
def isSimilar(x: Any): Boolean | |
def isNotSimilar(x: Any): Boolean = !isSimilar(x) | |
} | |
val b = 25 | |
val foo = new Similarity() { | |
var x: Int = b | |
def isSimilar(x: Any): Boolean = { |
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
val main = play.Project(appName, appVersion, appDependencies).settings( | |
// Add your own project settings here | |
resolvers += "scala-redis" at "https://github.com/debasishg/scala-redis.git", | |
resolvers += "scala-riak-client" at "https://github.com/agemooij/riak-scala-client.git" | |
) |
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
$("div#submit").click( function(e) { | |
var today = new Date(); | |
var now = today.getTime(); | |
var age_limit = now - 410240038000; | |
var y = ( !isNaN(parseInt( $('#year_field').val() )) ) ? parseInt( $('#year_field').val() ) : 2010; | |
var m = ( !isNaN(parseInt( $('#month_field').val() )) ) ? parseInt( $('#month_field').val() ) -1 : 0 ; | |
var d = ( !isNaN(parseInt( $('#day_field').val() )) ) ? parseInt( $('#day_field').val() ) : 0; |