JSFiddle - React, Tailwind, and code Playground

by eurica

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js">
<script>
$.getJSON("http://search.twitter.com/search.json?q=euri&rpp=5&callback=?", function(data)
{
	console.log(data)
    //$(data.results).each(function(i,v){console.log(v)}
})
</script>

//Twitter gets a little fresh with links, so let's skip them
$(".twitter-timeline-link").remove()

tweetToChar = function(tweet) {
str = tweet.text()
}
s=$(".tweet-text").first().text()


s=$(".tweet-text").first()
s="A facsimile of an observer mission for a facsimile of an election in a facsimile of a state. Democracy in Donetsk: "
s=s.replace(/\W/g,'')
secret_message = "Drink your Ovaltine";
c=secret_message.charCodeAt(0);
console.log(c);
ss = String.fromCharCode(c);
console.log(ss);




hashCode = function(s) {
  var hash = 0;
  for (i = 0; i < s.length; i++) {
	hash = hash + s.charCodeAt(i);
	console.log(hash);
  }
  return hash%255;
};

  var str = value.text()
  var h = hashCode(str)
  encoded = encoded + String.fromCharCode(h)

encoded = "";
jQuery.each($(".tweet-text"), function( index, value ) {
  str = $(value).text().replace(/\W/g,'')
  var h = hashCode(str)
  encoded = encoded + String.fromCharCode(h) 
});
alert(encoded)



hash = 0;
for (i = 0; i < s.length; i++) {
hash = hash + s.charCodeAt(i);
console.log(hash);
}


s.charCodeAt(1);


s.hashCode()

String.fromCharCode(65,66,67)





s="A facsimile of an observer mission for a facsimile of an election in a facsimile of a state. Democracy in Donetsk: "
s=s.replace(/\W/g,'')

hash = 0;
for (i = 0; i < s.length; i++) {
hash = hash + s.charCodeAt(i);
console.log(hash);
}
hash = hash % 255
console.log(hash)

secret_message = "Drink your Ovaltine";
c=secret_message.charCodeAt(0);
console.log(c);
ss = String.fromCharCode(c);
console.log(ss);

JavaScript

hashCode = function(s) {
  var hash = 0;
  for (i = 0; i < s.length; i++) {
	hash = hash + s.charCodeAt(i);
	console.log(hash);
  }
  return hash%100+32; //Not exactly the right range, but 100 is easy
};

str = "010-:+().?!azAZ"

for(i=0; i<127; i++){
    console.log(i + ": " +String.fromCharCode(i));
}