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 cc.datafabric.infoexchange.streams.gate; | |
import com.salesforce.kafka.test.junit5.SharedKafkaTestResource; | |
import de.bwaldvogel.mongo.MongoServer; | |
import de.bwaldvogel.mongo.backend.memory.MemoryBackend; | |
import org.junit.jupiter.api.Assertions; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.extension.RegisterExtension; | |
import java.net.InetSocketAddress; |
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
PREFIX fts: <https://w3id.org/datafabric.cc/ontologies/fts#> | |
SELECT ?ogrn ?primaryCode ?fullname WHERE { | |
?leUri a fts:C101_Russian_Legal_Entity . | |
?addressE a fts:C39_Address_Entity ; | |
fts:p82_refers_to_company ?leUri ; | |
fts:isLatestEntity "true"^^xsd:boolean ; | |
fts:p18_postcode "193231" . |
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
## | |
## Возвращает список учредителей ООО ДатаФабрик | |
## | |
from SPARQLWrapper import SPARQLWrapper, JSON | |
sparql = SPARQLWrapper("http://104.155.96.199/blazegraph/sparql") | |
sparql.setQuery(""" | |
PREFIX fts: <https://w3id.org/datafabric.cc/ontologies/fts#> |
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'; | |
const nl = require('nools'); | |
class Message { | |
constructor() { | |
this.text = ''; | |
} |
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 Queue = require('bull'), | |
path = require('path'), | |
fs = require('fs'), | |
_ = require('lodash') | |
if (process.argv.length <= 2) { | |
console.log("Usage: " + __filename + " path/to/directory"); | |
process.exit(1); |
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
(function (data) { | |
env.async.waterfall([ | |
env.async.apply( | |
env.model[data.model].findOne, | |
env.lodash.defaults(data.findParams || {}, { | |
name: data.name, | |
value: data.payload.value | |
})), | |
function(found, next) { | |
if (found) { |
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
You need to do base backups often... | |
sudo -u postgres envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /usr/local/pgsql/data | |
You can check how many objects are not archived: | |
./var/backup_status.sh |
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
# WAL-E (https://github.com/wal-e/wal-e) install | |
sudo su | |
source /var/.cloud66_env | |
sudo apt-get install daemontools | |
sudo apt-get install -y python-virtualenv python-dev git libevent-dev pv lzop vim | |
sudo pip install git+https://github.com/wal-e/wal-e | |
umask u=rwx,g=rx,o= | |
mkdir -p /etc/wal-e.d/env | |
echo $AWS_SECRET_ACCESS_KEY > /etc/wal-e.d/env/AWS_SECRET_ACCESS_KEY |
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
def available_awards | |
# не даем, если награда уникальна и уже выдана | |
return [] if @award.unique? && award_exists? | |
# не даем, если пользователь не подходит по группе | |
return [] if (@award.for_group? == false) || | |
(@award.group_ids & @user.group_memberships.pluck(:group_id)).any? | |
# не даем, если награда дневная и она уже была выдана | |
return [] if (@award.main_slot? || @award.bonus_slot?) && (day_count == 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
from mongo import * | |
from api.maps import * | |
from api.poster import * | |
import json as simple_json | |
from bson import json_util | |
from datetime import datetime | |
def json_serial(obj): | |
if isinstance(obj, datetime): |
NewerOlder