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 lecture | |
import org.junit.runner.RunWith | |
import org.scalatest.{Matchers, FunSuite} | |
import org.scalatest.junit.JUnitRunner | |
import org.scalatest._ | |
import scala.concurrent.{Await, Future, Promise} | |
import scala.util.Success | |
import scala.async.Async._ |
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
"use strict"; | |
var Rx = require('rx'); | |
var axios = require('axios'); | |
var city = 'seoul'; | |
var api = 'http://api.openweathermap.org/data/2.5/weather?mode=json&units=metric&q=' + city; | |
var p = axios.get(api); /* promise */ | |
var o = Rx.Observable |
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
// Syrup | |
this.formatDate = function(num){ | |
var fom = ""; | |
var iNum; | |
if(!isNaN(num)){ | |
iNum = Number(num); | |
if(iNum < 10) { fom = "0" + iNum; } | |
else { fom = "" + iNum; } |
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
<script type="text/javascript"> | |
var isDev = true; | |
var token = "token"; | |
var rakeJSVersion = "1.3"; | |
(function(e,b){var versionConnector=rakeJSVersion==""?"":"-"; if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;if(isDev){a.src='https://pg.rake.skplanet.com:8443/log/resources/js/rake-skp.test'+versionConnector+rakeJSVersion+'.min.js';}else{a.src='https://rake.skplanet.com:8443/log/resources/js/rake-skp'+versionConnector+rakeJSVersion+'.min.js';};f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview tr |
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
rake_lat.init({ | |
log_version : rakeJSVersion, | |
current_page : "/detail/brand_latency", | |
latency_flag : "Y", | |
latency_module_cnt : 7, | |
latency_time_stamp: rake_lat.getLatencyId() | |
}); | |
// rake_lat.sendRakeData({latency_module_order : "0"}); | |
setTimeout(function() { |
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
/* | |
* | |
* rake-javascript-skp | |
* =================== | |
* | |
* ## Javascript Library for web application tracking ## | |
* ### based on Mixpanel JS Library ### | |
* | |
* Mixpanel JS Library v2.2.0 | |
* |
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 isDev = true; | |
var token = "your rake token"; | |
var rakeJSVersion = 1.5; | |
(function(e,b){var versionConnector=rakeJSVersion==""?"":"-"; if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;if(isDev){a.src='https://pg.rake.skplanet.com:8443/log/resources/js/rake-skp.test'+versionConnector+rakeJSVersion+'.min.js';}else{a.src='https://rake.skplanet.com:8443/log/resources/js/rake-skp'+versionConnector+rakeJSVersion+'.min.js';};f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable collect flush track track_pageview track_links tra |
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
#! /usr/bin/python | |
import smtplib | |
from optparse import OptionParser | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.image import MIMEImage | |
from email.mime.application import MIMEApplication |
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
import scalaz.\/ | |
import scalaz.syntax.either._ | |
object Example2 { | |
// This example simulates error handling for a simple three tier web application | |
// | |
// The tiers are: | |
// - the HTTP service | |
// - a user authentication layer | |
// - a database layer |
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
import org.scalatest._ | |
import monocle._, Monocle._, monocle.macros._ | |
/* ref - http://www.slideshare.net/JulienTruffaut/beyond-scala-lens */ | |
class HttpRequestSpec extends WordSpec with Matchers { | |
import HttpRequestSpec._ | |
val r1 = HttpRequest( | |
GET, | |
URI("localhost", 8080, "/ping", Map("hop" -> "5")), |