Skip to content

Instantly share code, notes, and snippets.

View ykhrustalev's full-sized avatar

Yuri Khrustalev ykhrustalev

View GitHub Profile
# modules/installer/cd-dvd/installation-cd-wifi.nix
{ config, ... }:
{
imports = [ ./installation-cd-graphical-gnome.nix ];
boot.kernelModules = [ "88x2bu" ];
boot.extraModulePackages = [
config.boot.kernelPackages.rtl88x2bu
];
https://medium.com/@zitko/structuring-a-vue-project-authentication-87032e5bfe16
https://medium.com/@jcbaey/authentication-in-spa-reactjs-and-vuejs-the-right-way-e4a9ac5cd9a3
@ykhrustalev
ykhrustalev / create-ssl-cert.sh
Created December 12, 2018 13:16 — forked from ArnaudValensi/create-ssl-cert.sh
Generate a self signed certificate without passphrase for private key
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes
#
# pipenv:
#
# [packages]
# google-api-python-client = "*"
# google-auth = "*"
from google.oauth2 import service_account
from googleapiclient.discovery import build
@ykhrustalev
ykhrustalev / postgres_queries_and_commands.sql
Created September 18, 2018 09:42 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
use std::iter::FromIterator;
impl std::fmt::Display for heap::ArrayHeap<i32> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
let x = std::vec::Vec::from_iter(self.items().iter().map(|x| x.to_string())).join(",");
std::fmt::Display::fmt(&x, f)
}
}
@ykhrustalev
ykhrustalev / LocalStorage.ts
Created March 25, 2018 13:48 — forked from picode7/ LocalStorage.ts
LocalStorage TypeScript Module
/**
* Check if localStorage is supported const isSupported: boolean
* Check if localStorage has an Item function hasItem(key: string): boolean
* Get the amount of space left in localStorage function getRemainingSpace(): number
* Get the maximum amount of space in localStorage function getMaximumSpace(): number
* Get the used space in localStorage function getUsedSpace(): number
* Get the used space of an item in localStorage function getItemUsedSpace(): number
* Backup Assosiative Array interface Backup
* Get a Backup of localStorage function getBackup(): Backup
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true)
@ykhrustalev
ykhrustalev / StorageHelper.ts
Created March 25, 2018 13:48 — forked from Digiman/StorageHelper.ts
Simple helper module on TypeScript for using local storage (HTML5) in browser. Also have the class to store the list of emails that need to use for autocomplete in the some pages.
// module with classes and logic for working with local storage in browsers via JavaScript
// see also: http://professorweb.ru/my/html/html5/level5/5_1.php
module StorageHelper {
export interface IStorageItem {
key: string;
value: any;
}
export class StorageItem {
key: string;

Keybase proof

I hereby claim:

  • I am ykhrustalev on github.
  • I am ykhrustalev (https://keybase.io/ykhrustalev) on keybase.
  • I have a public key whose fingerprint is 2831 1FF8 46F6 901F 5E2C 9301 9232 2AE1 BF49 B600

To claim this, I am signing this object:

from __future__ import print_function
import SimpleHTTPServer
import SocketServer
import sys
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)