Instantly share code, notes, and snippets.

View cloudSettings
{"lastUpload":"2018-10-18T09:54:45.175Z","extensionVersion":"v3.2.0"}
View scard.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
using namespace std;
ifstream fi ("/Users/toan/ued/18-10-2018/SCARD.INP");
ofstream fo ("/Users/toan/ued/18-10-2018/SCARD.OUT");
View formdata-example.js
var file = $('#order_file').prop('files')[0];
var form_data = new FormData();
form_data.append('order_file',file)
$.each($('#ordercreate').serializeArray(), function (key, input) {
if (form_data.has(input.name)) {
form_data.set(input.name, input.value);
} else {
form_data.append(input.name, input.value);
}
});
View lab4.sql
select first_name, last_name from persons
where first_name like "A%"
select first_name, last_name from persons
where first_name like "%A"
select first_name, last_name from persons
where first_name like "%A%"
select first_name, last_name from persons
View output_log.txt
Log uploaded on Thursday, October 18, 2018, 5:53:24 AM
Loaded mods:
Core: (no assemblies)
Miscellaneous 'CORE': ColonistKeys(0.19.0.0), CommonMisc(0.19.0.0)
Misc. Robots: AIRobot(0.19.0.0)
Misc. Robots++: (no assemblies)
HugsLib[6.0.1]: 0Harmony(1.2.0.1), HugsLib(1.0.0.0)
What the hack?![1.0.0]: $HugsLibChecker(0.5.0.0), WhatTheHack(1.0.0.0)
Children, school and learning: 0Harmony(1.2.0.1), Children(1.0.0.0), ChildrenHelperClasses(1.0.0.0)
EdB Prepare Carefully: 0Harmony(1.1.0.0), EdBPrepareCarefully(1.0.10.0)
View admin.py
# 나머지 부분은 똑같습니다.
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
list_display = ('name', 'author', 'introduction')
admin.site.register(Wisesaying)
View es-cqrs-obstacles.md

Uniqueness:

  • Single value table on command side with index
  • Implementable as service or sth. like that

Crossing ES borders:

  • Use ProcessManager for creating ES-external entities
View result_page.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js-rich</title>
</head>
<body style="background-color: gray">
<div>Вёрстка сайта</div>
View .htaccess
# general cache control :: max-age in seconds
<filesMatch ".(ico|pdf|flv|jpg|svg|jpeg|png|gif|js|css|swf)$"> # choose the files extensions here
Header set Cache-Control "max-age=7776000, public" # 90 days
</filesMatch>
# specific path to css files example
<filesMatch "^path/to/files/*\.css$">
Header set Cache-Control "max-age=84600, public"
</filesMatch>
View after_optimistic.js
import React, { Component } from 'react';
import axios from 'axios';
class App extends Component {
state = {
followedChannel: []
};
componentDidMount() {
var self=this;