Skip to content

Instantly share code, notes, and snippets.

View whatvn's full-sized avatar

Hung whatvn

View GitHub Profile
\item{
\textbf{Con ga}{: \href{https://conga.com/ }{https://conga.com}}
}
import asyncio
class asyncOp(object):
def __init__(self, loop):
self.loop = asyncio.get_event_loop()
def run(self, op, callback):
task = self.loop.create_task(op)
import asyncio
class asyncOp(object):
def __init__(self, op, callback):
self.op = op
self.loop = asyncio.get_event_loop()
self.task = self.loop.create_task(self.op)
self.task.add_done_callback(callback)
package spray.examples
import scala.util.{Success, Failure}
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.pattern.ask
import akka.event.Logging
import akka.io.IO
import spray.json.{JsonFormat, DefaultJsonProtocol}
import spray.can.Http
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 1. in line 1.
1 ECU = 1GCU, GCP fixs 2.75 GCU/CPU, EC2 provides ECU as dynamic range based on instance type. This compares EC2 vs GCP based on number of ECU & GCU
Gamma Current Usage GCP Amazon EC2 GCP Price EC2 Price
CPU GCU Ram CPU ECU Ram
(1)C3.Large 4 11 4 2 8 4 94.48 96.63
(3) c3.2xlarge 12 33 15 8 28 15 302.2 387.23
(4) c3.xlarge 6 16.5 7.5 4 14 7.5 151.1 193.98
(1)C4.Large 4 11 4 2 8 3.75 94.48 105.41
@whatvn
whatvn / theoyeucau.py
Last active July 6, 2016 05:35
download all radio espisode from theoyeucau.com in one shot
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import os
import urllib2
ESPISODE_LINK="http://www.theoyeucau.com/episode"
ESPISODE_LINK_REGEX = re.compile("http\:\/\/www\.theoyeucau\.com\/episode\/[a-zA-Z-]+\/")
updateShipper(id, goods, function (shippers) {
if (shippers.length) {
response = send(shippers, options, callback);
} else {
response = deny(options, callback);
}
});
Muốn lấy cái giá trị response trả về
@whatvn
whatvn / 1smallestin1bil.py
Last active May 12, 2016 11:59
find 1 mil smallest number in 1 bil input number
# origin question&answer
# http://www.vithon.org/2015/04/30/ph%E1%BB%8Fng-v%E1%BA%A5n:-tim-1-tri%E1%BB%87u-s%E1%BB%91-nh%E1%BB%8F-nh%E1%BA%A5t-trong-1-t%E1%BB%B7-s%E1%BB%91
# the origin version use heapq
# this version do not use external module, but use sorted cheat when iterate through set (is not sorted)
def solve(inp, n=1000000):
print inp
heap = set()
for i in inp:
i = -i
MediaPlayer.dependencies.FragmentLoader = function () {
"use strict";
var RETRY_ATTEMPTS = MediaPlayer.dependencies.FragmentLoader.RETRY_ATTEMPTS,
RETRY_INTERVAL = MediaPlayer.dependencies.FragmentLoader.RETRY_INTERVAL,
xhrs = [],
doLoad = function (request, remainingAttempts) {
00:00:00 687 debug Skipping splice frame generation: first new buffer at 1292933us begins at or before existing buffer at 1292933us.
00:00:00 687 debug Skipping splice frame generation: first new buffer at 6721733us begins at or before existing buffer at 6721733us.
00:00:01 292 debug Skipping splice frame generation: first new buffer at 1292933us begins at or before existing buffer at 1292933us.
00:00:01 293 debug Skipping splice frame generation: first new buffer at 6721733us begins at or before existing buffer at 6721733us.
00:00:01 904 debug Skipping splice frame generation: first new buffer at 1292933us begins at or before existing buffer at 1292933us.
00:00:01 905 debug Skipping splice frame generation: first new buffer at 6721733us begins at or before existing buffer at 6721733us.
00:00:02 517 debug Skipping splice frame generation: first new buffer at 1292933us begins at or before existing buffer at 1292933us.
00:00:02 517 debug Skipping splice frame generation: first new buffer at 6721733us begins at