Skip to content

Instantly share code, notes, and snippets.

View voronianski's full-sized avatar

Dmytro Voronianski voronianski

View GitHub Profile
@Albert-W
Albert-W / embed gist.md
Last active November 18, 2024 20:51
embed gist in iframe

Embed gist in iframe

it is used to embed gist to an asynchronously-loaded web pages.

<iframe 
    width="100%"
    height="350"    
    src="data:text/html;charset=utf-8,
 
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active February 21, 2025 11:43
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@jherax
jherax / arrayFilterFactory.1.ts
Last active February 20, 2025 05:05
Filters an array of objects with multiple match-criteria.
type FilterOperator = 'AND' | 'OR';
type FiltersBy<T> = {
[K in keyof T]?: (value: T[K]) => boolean;
};
/**
* Factory function that creates a specialized function to filter
* arrays, by validating all filters (AND operator),
* or validating just one of the filters (OR operator).
* @param operator Method to validate all filters: AND, OR
import React, { Component, PropTypes } from 'react';
class OutsideClick extends Component {
static propTypes = {
children: PropTypes.any,
onClick: PropTypes.func.isRequired,
id: PropTypes.string,
tag: PropTypes.string,
className: PropTypes.string
}
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
@langpavel
langpavel / GraphQLTimestamp.js
Last active July 28, 2023 08:46
GraphQLTimestamp.js
import { Kind } from 'graphql/language';
import { GraphQLScalarType } from 'graphql';
function serializeDate(value) {
if (value instanceof Date) {
return value.getTime();
} else if (typeof value === 'number') {
return Math.trunc(value);
} else if (typeof value === 'string') {
return Date.parse(value);
@spaze
spaze / opera-vpn.md
Last active December 22, 2024 15:50
Opera VPN behind the curtains is just a proxy, here's how it works

2023 update

ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.

🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.


When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@Spaxe
Spaxe / oceanic-next.css
Last active February 16, 2016 10:27
Oceanic Next RainbowJS Theme
/**
* Oceanic Next Theme for RainbowJS (https://github.com/ccampbell/rainbow)
*
* Adaptation of Oceanic Next from
* https://github.com/voronianski/oceanic-next-color-scheme
*
* Usage: include this file in your HTML like this:
* <link rel="stylesheet" type="text/css" href="css/oceanic-next.css">
*
* Anything transformed by RainbowJS will be automatically applied.