Skip to content

Instantly share code, notes, and snippets.

View larryzhao's full-sized avatar
🐱
Meow

Larry Zhao larryzhao

🐱
Meow
View GitHub Profile
@larryzhao
larryzhao / gist:7913394
Last active December 31, 2015 01:19
Grape on Goliath
require 'goliath'
require 'grape'
module Myapp
class API < Grape::API
version 'v1'
format :json
get '/ping' do
{ ping: "pong" }
function batchImport(season, type) {
var script = "// Starting point \n $('.icon-btn-download').trigger('click'); \n\n";
var resourceType = type.toUpperCase();
var url
var timeout = 500;
console.log($(".resource-item[data-format=" + resourceType + "][data-season=" + season + "]").length);
$(".resource-item[data-format=" + resourceType + "][data-season=" + season + "]").each(function(index, element){
var $resourceItem = $(element);
@larryzhao
larryzhao / application_helper.rb
Created January 28, 2015 16:35
Newrelic Support
module ApplicationHelper
...
def present(object, klass = nil)
klass ||= "#{object.class}Presenter".constantize
presenter = klass.new(object, self)
yield presenter if block_given?
presenter
end
GIT
remote: git://gitcafe.com/larryzhao/rails_emoji.git
revision: d1831cddf39dff21384693cdf9e892fbc7603fe2
branch: maleskine
specs:
rails_emoji (1.7.0)
rails (>= 3.1.0)
GIT
remote: git://github.com/alexandru/stuff-classifier.git
// MySQLTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "mysql_connection.h"
#include "mysql_driver.h"
#include "cppconn\statement.h"
#include "cppconn\resultset.h"
// PgTest.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "libpq-fe.h"
#include <iostream>
#include <WinSock2.h>
#include <time.h>
#include <string.h>
#include <sstream>
#include <vector>

###如何导入原始数据

  • 查看导入原始数据配置是否正确,配置应该存在于项目 preprocess/sql 目录下面,文件名叫 config.json
  • 运行 preprocess 项目
  • 点击 导入数据
  • 选择存放原始数据文本文件的文件夹,就可以开始导入
  • 原始数据文本文件的文件名需要和配置中写明的完全一致。

###如何修改原始数据文件编码

编程的智慧
简叔咖啡馆20151026-你看过哪些书名平(坑)平(爹),内容却非常精彩的书 ?
是情还是色?适合女生看的9部情色电影。
那些脑洞大开创意满满的神奇短篇动画(第二弹)
为什么我不给孩子看国产动漫?看看这5部法国动漫,你就知道了!
推荐的10部长篇小说
如何从一个空有上进心的人,变成行动上的巨人?
高效记笔记,你可以的
上瘾五万年--读戴维•考特莱特《上瘾五百年》
聊聊终生学习这件事
{
"tables": [
{
"txtFileName": "absolute_nav_data_fused.txt",
"tableName": "ac_nav_data_raw",
"skipLinesCount": 8,
"leadingFieldsCount": 18,
"nonRepeatedFields": {
"time": 1,
"msg_publish_time_ac_nav": 2,
@larryzhao
larryzhao / migrate.rb
Last active October 8, 2016 16:20
Migrate Sidekiq.
jobs = []
# Read from Old Sidekiq
ss = Sidekiq::ScheduledSet.new
ss.each do |job|
value = JSON.parse(job.value)
if value["class"] == "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper"
# this is an active job