Skip to content

Instantly share code, notes, and snippets.

@ibrahimhajjaj
ibrahimhajjaj / open_folder_in_PhpStorm_2020.bat
Last active May 14, 2024 10:22
Add Open Folder in PHPStorm to Windows Context Menu
@echo off
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.3.3\bin\phpstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding within a folder entries
@JohnyDeath
JohnyDeath / Установка Outline VPN на Ubuntu 20.04.md
Created March 4, 2022 19:36 — forked from YPermitin/Установка Outline VPN на Ubuntu 20.04.md
Инструкция по развертыванию собственного VPN-сервиса на базе Outline VPN

Установка Outline VPN на Ubuntu 20.04

Outline VPN - это бесплатный инструмент с открытым исходным кодом, позволяющий развернуть собственную VPN на Вашем собственном сервере или на машине облачного провайдера. Подробную информацию Вы можете узнать здесь и здесь.

В своем составе имеет как графические инструменты, так и средства работы через командную строку. Позволяет использовать VPN как на настольных компьютерах, так и на мобильных устройствах.

Прежде чем начать

Вам нужен сервер. Да, его нужно арендовать, учитывая его местоположение. Например, если Вам нужно получать доступ к ресурсам, которые недоступны в текущем местоположении, но доступны, например, в Канаде, то смело арендуйте виртуальную машину в AWS, Digital Ocean или любом другом месте.

@HimDek
HimDek / Hyper-V in Windows 10 and Windows 11 Home Edition.md
Last active May 14, 2024 10:22
Hyper-V is supported in Pro, Enterprise and Education Edition of Windows 10 and Windows 11. This guide will show you how to enable Hyper-V in Home Editions of Windows 10 and Windows 11.

Hyper-V in Windows 10 and Windows 11 Home Edition

Hyper-V in Windows 10 and Windows 11 allows running Virtual Machine. It is supported only in Pro, Enterprise and Education Edition of Windows 10 and Windows 11 by default. But this guide will show you how to enable it in Home Editions of Windows 10 and Windows 11.

Check if virtualization is enabled:

  • Search for Command Prompt in Windows Start Menu and open it.
  • Type systeminfo and press Enter. Wait for the process to finish
  • Once the results appear, search for the Hyper-V Requirements section which is usually the last one. 11
    • If it says A hypervisor has been detected. Features required for Hyper-V will not be displayed. that means Hyper-V is already enabled and there is no reason following this guide anymore.
  • Otherwise, check for Virtualization Enabled in Firmware:.
@Lissy93
Lissy93 / Example 1 - Getting Started - conf.yml
Last active May 14, 2024 10:19
Example Config Files for Dashy
---
# Page meta info, like heading, footer text and nav links
pageInfo:
title: Dashy
description: Welcome to your new dashboard!
navLinks:
- title: GitHub
path: https://github.com/Lissy93/dashy
- title: Documentation
path: https://dashy.to/docs
@koshigoe
koshigoe / mount-ram.sh
Created February 11, 2011 14:57
Like tmpfs in Mac OSX
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active May 14, 2024 10:18
Install pyenv on Ubuntu 18.04 + Fish shell
Install pyenv on Ubuntu 18.04 + fish shell
- Install the packages required to compile Python
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Download pyenv code from github
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@mogarick
mogarick / utcTimestampsWithTimezone.js
Last active May 14, 2024 10:16
Getting UTC timestamps of iCal with Timezone using the mozilla-comm/ical.js lib
//Please note I'm also using underscore each function for the iterations
//iCal -> jsCal
var icalEvents = ICal.parse(iCalStringData);
//jsCal->Component
var comp = new Component(icalEvents[1]);
//Get all VTIMEZONE iCalendar components
var vtimezones = comp.getAllSubcomponents("vtimezone");
//Add all timezones in iCalendar object to TimezonService
import Combine
import UIKit
public protocol CombineCompatible {}
// MARK: - UIControl
public extension UIControl {
final class Subscription<SubscriberType: Subscriber, Control: UIControl>: Combine.Subscription where SubscriberType.Input == Control {
private var subscriber: SubscriberType?
private let input: Control