Skip to content

Instantly share code, notes, and snippets.

View ivan-hilckov's full-sized avatar
🤔

Ivan Hilkov ivan-hilckov

🤔
View GitHub Profile
@ivan-hilckov
ivan-hilckov / osx_keyboardspeed.sh
Created June 5, 2019 03:59 — forked from karolyi/osx_keyboardspeed.sh
Mac OS X super fast keyboard speed
#!/usr/bin/env bash
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/
#echo "Disable press-and-hold for keys in favor of key repeat"
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 0.02
@ivan-hilckov
ivan-hilckov / example.jsx
Created May 14, 2019 00:21 — forked from bvaughn/LICENSE.md
Advanced example for manually managing subscriptions in an async-safe way using hooks
import React, { useMemo } from "react";
import useSubscription from "./useSubscription";
// In this example, "source" is an event dispatcher (e.g. an HTMLInputElement)
// but it could be anything that emits an event and has a readable current value.
function Example({ source }) {
// In order to avoid removing and re-adding subscriptions each time this hook is called,
// the parameters passed to this hook should be memoized.
const subscription = useMemo(
() => ({
curl 'http://localhost:3000/api/project-unit-attach/'
-H 'Pragma: no-cache'
-H 'Origin: http://localhost:3000'
-H 'Accept-Encoding: gzip, deflate, br'
-H 'Accept-Language: en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36'
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundarylWSEVMfoFbMJtzUd'
-H 'Accept: application/json'
-H 'Cache-Control: no-cache'
-H 'Referer: http://localhost:3000/project/21/upload/unit-attach/164'
@ivan-hilckov
ivan-hilckov / LittleSnitch_Block_List.md
Created January 1, 2019 21:07 — forked from SethCalkins/LittleSnitch_Block_List.md
Little Snitch Script to block Ad Servers

Here is a script to take the hosts from From http://pgl.yoyo.org/adservers/ and convert them to rules for Little Snitch.

It has options to grab the entire list or grab new entries past a certain date.

Just grab the output and copy/paste into Little Snitch.

The script is written to block access to any process, any port. You can also delete those lines and it will only block Mail. Or use the options to enter any process, port or protocol you want to block.

let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@ivan-hilckov
ivan-hilckov / option1.py
Created November 5, 2018 23:09 — forked from douglasmiranda/option1.py
Fix: Django Debug Toolbar not showing when using with Docker.
# If you don't do this you will have to add the host IP in INTERNAL_IPS = ('127.0.0.1',)
# And it will change, then you will have to change INTERNAL_IPS again.
def show_toolbar(request):
if request.is_ajax():
return False
return True
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'config.local.show_toolbar',
@ivan-hilckov
ivan-hilckov / yarn.unlock.md
Created November 4, 2018 03:45 — forked from RadValentin/yarn.unlock.md
Solve `yarn.lock` or `package.json` conflicts without losing your mind

NOTE: This guide is ONLY for devs who don't want to edit their yarn.lock file by hand. If you don't care about that please carry on.


So you've pulled the latest master

git checkout master
git pull
@ivan-hilckov
ivan-hilckov / commands.js
Created October 25, 2018 15:22
Общие куски для всех тестов
import { URLS, PATH_NAME } from '../../src/constants/path'
import ENDPOINTS from '../../src/constants/endpoints'
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
@ivan-hilckov
ivan-hilckov / project.spec.js
Created October 25, 2018 15:18
Спека для страницы /project/:projectId
/// <reference types="Cypress" />
import { URLS, PATH_NAME } from '../../src/constants/path'
const projectId = 3
const ids = {
layer: 'layer-add',
}
describe('Project', () => {
@ivan-hilckov
ivan-hilckov / layer.spec.js
Created October 25, 2018 15:17
Спека для страницы /project/:projectId/layer
/// <reference types="Cypress" />
import { URLS, PATH_NAME } from '../../src/constants/path'
const projectId = 3
const notExistProjectId = 9999
const ids = {
close: 'close',
title: 'form-title',
subtitle: 'form-subtitle',