Skip to content

Instantly share code, notes, and snippets.

@dshster
dshster / log.md
Created March 7, 2025 12:59
QwQ, рассуждения по загадке

Ещё одна загадка на рассуждения, рассуждай и отвечай на русском языке! Вот загадка: Шли муж с женой, брат с сестрой, шурин с зятем. Сколько всего было людей?

Okay, let's tackle this riddle step by step. The question is in Russian, so I need to make sure I understand all the terms correctly. The riddle says: "Шли муж с женой, брат с сестрой, шурин с зятем. Сколько всего было людей?" which translates to: "A husband and wife were walking, a brother and sister, a brother-in-law and son-in-law. How many people were there in total?"

First, I need to parse each pair mentioned:

  1. Муж с женой (Muzh s zhenoy) — Husband and wife.
  2. Брат с сестрой (Brat s sestroy) — Brother and sister.
@dshster
dshster / after_res_hooks.js
Created January 1, 2018 18:09 — forked from pasupulaphani/after_res_hooks.js
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@dshster
dshster / application.js
Created October 7, 2017 13:48
Yandex Maps random polygones
const margin = 200;
const theta = 0.2;
function getRandomCoords({ width, height }) {
return {
top: Math.random() * (width - margin) + margin / 2,
left: Math.random() * (height - margin) + margin / 2,
};
}
@dshster
dshster / InstagramImgDownload.js
Created June 12, 2016 10:52
Append download link to instagram photos (userscript)
// ==UserScript==
// @name Instagram image in a new tab
// @namespace http://shvalyov.ru
// @version 0.1
// @description append download link to photos
// @author dshster
// @match https://www.instagram.com/*
// @grant none
// ==/UserScript==
@dshster
dshster / application.js
Created March 4, 2016 18:31
Angular e2e with http mock
(function(application, dependencies) {
angular.module(application, dependencies);
})('application', []);
(function(application) {
angular.module(application)
.controller('SampleController', SampleController);
SampleController.$inject = ['$http'];
@dshster
dshster / application.js
Created February 16, 2016 13:07
Angular bootstrap
var application = 'application';
angular.module(application, ['ngMockE2E']);
angular.module(application)
.controller('SampleController', function(SampleServices) {
var Sample = this;
SampleServices.getServerData().then(function(result) {
Sample.serverData = result;
@dshster
dshster / entry.js
Last active February 16, 2016 08:57
Webpack PostCSS bootstrap
var css = require('./styles.postcss');

Install:

npm install

Run:

gulp

@dshster
dshster / application.js
Last active August 29, 2015 14:17
AngularJS backend-less development
'use strict';
var application = 'application';
var dependences = ['ngMockE2E'];
angular.module(application, dependences)
.config(['$compileProvider', function($compileProvider) {
$compileProvider.debugInfoEnabled(false);
}])

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {