Skip to content

Instantly share code, notes, and snippets.

@butaji
butaji / app-en.js
Created February 21, 2023 03:41
Top 5000 Spanish sentences audio generation
var lineReader = require('readline').createInterface({
input: require('fs').createReadStream('sample.txt')
});
var values = {}
var i = 0
var s = 1
lineReader.on('line', function (line) {
i++;
@butaji
butaji / Program.cs
Created December 6, 2020 16:39
Покоряем ASP.NET (.NET, Windows, C#, Rider IDE) - Вечерний Сниппет
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace WebApplication
@butaji
butaji / app.js
Created November 29, 2020 15:11
Вечерний Сниппет (node.js)
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.get('/api', (req, res) => {
@butaji
butaji / read_calendar_events.swift
Last active March 28, 2020 19:02
Read events from all calendars
import Cocoa
import EventKit
var meetings = [String: String]()
let eventStore = EKEventStore()
switch EKEventStore.authorizationStatus(for: EKEntityType.event) {
case .authorized: break
const natural = require('natural');
const extract = require('article-parser').extract;
const run = (c, url) => {
natural.BayesClassifier.load('classifier.json', null, async(err, classifier) => {
if (err) {
console.log(err);
classifier = new natural.BayesClassifier();
import logging
import cv2
import numpy
import glob, os
faceClassifier = cv2.CascadeClassifier()
faceClassifier.load('haarcascade_frontalface_default.xml')
imageProbes = []
typeProbes = []
//
// ZeroInboxToolbar.m
// GMailinator
//
// Created by Vitaly Baum on 1/5/17.
// Copyright © 2017 nompute. All rights reserved.
//
#import "ZeroInboxToolbar.h"
#import "ZeroInboxMessageViewer.h"
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/AndroidStudioProjects
rm -Rf ~/.gradle
rm -Rf ~/.android
rm -Rf ~/Library/Android*
@butaji
butaji / app.js
Last active May 17, 2024 03:15
Code sample for artice Practical Microservices: Integration Tests and Stub Services https://medium.com/@butaji/practical-microservices-integration-tests-and-stub-services-80749ce01050#.zdyycghvf
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
app.post('/setup', (req, res) => {
const body = req.body;
@butaji
butaji / api.js
Last active May 17, 2024 03:15
API and Backend services part for Correlation Token example https://medium.com/@butaji/practical-microservices-correlation-tokens-75888baa5182
const getUserId = () => Math.floor((Math.random() * 1000000) + 1); //yeah, it should be real user id
const myLogger = (req, res, next) => {
const token = req.method + "_" + req.path + "_" + getUserId() + "_" + new Date().getTime();
console.log(token);
req["app_token"] = token;
next();
};
app.get('/products', (req, res) => {