Skip to content

Instantly share code, notes, and snippets.

View ruvasik's full-sized avatar
👁️‍🗨️
I'm looking for job

Vladimir Alekseev ruvasik

👁️‍🗨️
I'm looking for job
View GitHub Profile
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@codedokode
codedokode / js-task-1.md
Last active July 13, 2024 16:42
Задания на яваскрипт (простые)
@bobuk
bobuk / gist:be3e9f5da7aa03557abf
Created January 1, 2015 19:18
AppleTV и проблемы AirPlay

После апдейта на iOS8 и OS X 10.10 я обнаружил, что работать с AppleTV стало невозможно. Все начало умирать, тормозить, дисконнектиться. Заикался даже звук, не только видео. Два месяца я терпел, два дня я думал, два часа я потратил на то, чтобы найти проблему и решение. Проблема оказалась закопана глубоко в анонс iOS8, прямо на сайте Apple. Вот тут

center

Поясню: в новых iOS и OS X в сочетании с третьим поколением AppleTV появилась новая крутая возможность. Тепреь не обязательно быть соединенным с одной и той же WiFi точкой, чтобы передавать изображение на AppleTV. Работает это так же, как, например, отправка фоток через AirDrop, технология похожа на WiFi Direct, только очень по-эппловски - широкими броадкастами пытается поймать все WiFi каналы, которые есть рядом. Работает все это прямо на чипе, который реализует WiFi и Bluetooth. И работает, надо сказать, ОЧЕНЬ плохо.

Но страшно не то, что работает это плохо, а то, что включно это

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@n-ts
n-ts / worker.js
Created October 3, 2018 20:21
Cloudflare Workers - Load balancing to nearest datacenter from current POP
/*
--------------------------------------------------------
Please note that this grouping is just for example...
You can rearrange POPs, remove or add dacaneters according to your needs.
--------------------------------------------------------
First, we have to get all Cloudflare POP codes (three letter airport codes) from https://www.cloudflarestatus.com/
North America is routed to Chigaco datacenter;
Europe, Africa and Middle East is routed to Amsterdam datacenter;
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@vanxh
vanxh / .dockerignore
Last active April 16, 2024 22:18
Dockerfile to deploy NextJS using yarn v3 (berry) PnP.
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
# .next
.git
.DS_Store
.yarn/*
!.yarn/cache
linux-orangepi
@ruvasik
ruvasik / random-fact.sh
Created November 18, 2023 10:45 — forked from jorpic/random-fact.sh
Get random fact from wikipedia
#!/bin/bash -e
API="http://en.wikipedia.org/w/api.php\
?action=query\
&prop=extracts\
&format=json\
&exsentences=2\
&explaintext=\
&exsectionformat=plain\
&rawcontinue=\
&generator=random\