Skip to content

Instantly share code, notes, and snippets.

View resure's full-sized avatar

Gadzhi Gadzhiev resure

View GitHub Profile
@resure
resure / wk-login.md
Last active December 17, 2020 21:49
Wikidot login problems
  1. Enter chrome://flags/#same-site-by-default-cookies in the address bar
  2. Disable selected option
  3. Restart browser
html, body {
background: #111 !important;
}
#hnmain {
background: #1a1a1a;
padding: 5px;
}
.subtext {
@resure
resure / SketchSystems.spec
Last active July 27, 2018 23:15
Соединения
Соединения
Список соединений
клик на соединение -> Страница Соединения
клик на новое соединение -> Создание соединения
Страница Соединения
Назад -> Соединения
Создание соединения
const vm = require('vm');
const instance = {};
for (let i = 0; i < 10; i++) {
const execStart = process.hrtime();
vm.runInNewContext('', instance);
const execEnd = process.hrtime(execStart);
console.log(`${execEnd[0]}s ${execEnd[1] / 1000000}ms`);
}
@resure
resure / server-center.js
Created July 30, 2014 21:29
Meteor External Auth
function centerAuth(loginRequest) {
var response = HTTP.call('POST', 'http://localhost:4567/auth',
{params: {username: loginRequest.username, password: loginRequest.password}});
response = JSON.parse(response.content);
if (response && response.response === 'ok') {
var userId = null;
var user = Meteor.users.findOne({ username: loginRequest.username });
if (! user) {
var add = (function () {
var counter = 0;
var f = function (x) {
counter += x;
return f;
};
f.valueOf = function () {
@resure
resure / fix.md
Created March 27, 2014 23:19
Ubuntu Radiance top bar fonts fix

Put this in /usr/share/themes/Radiance/gtk-3.0/apps/unity.css

.unity-panel.menubar,
.unity-panel .menubar {
  text-shadow: none;
}
@resure
resure / rssh.md
Last active August 29, 2015 13:56
Debian startup file for SSH port forwaring (connecting to Raspberry Pi behing NAT)

Run update-rc.d rssh defaults after adding this file to /etc/init.d on your Raspberry.

To SSH through NAT you should use "proxy" server (TARGET in this script) with GatewayPorts yes in its /etc/ssh/sshd_config.

After configuring middle server just run ssh pi@example.com -p 2242 to connect to your Raspberry behind the NAT.

@resure
resure / wikidot_export.py
Created November 18, 2013 18:02
wikidot_export.py
from xmlrpc.client import ServerProxy
import json
pages = []
wikidot = ServerProxy('https://username:api_key@scpfoundation.ru/xml-rpc-api.php')
pages_names = wikidot.pages.select({"site": "scp-ru"})
for page_name in pages_names:
p = wikidot.pages.get_one( { "site": "scp-ru", "page": page_name } )
del(p['html'])
@resure
resure / keymap.json
Created November 10, 2013 00:11
sublimetext config files
[
{ "keys": ["home"], "command": "move_to", "args": {"to": "hardbol", "extend": false} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "hardeol", "extend": false} },
{ "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false}},
{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false}},
{ "keys": ["ctrl+x","a"], "command": "select_all"},
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": ["ctrl+x", "f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },