Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Alexander I.Grafov grafov

Block or report user

Report or block grafov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@grafov
grafov / wwwsearch.sh
Created Mar 22, 2018
Web search in Surf with history (with using Rofi)
View wwwsearch.sh
#!/bin/dash
AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
#OPTS='-z 1.5 -u "$AGENT"'
OPTS="-z 1.8"
HISTORY=.rofi-wwwsearch-history
if [ "$1" = "" ]
then
@grafov
grafov / www.sh
Created Mar 22, 2018
Surf with history using Rofi
View www.sh
#!/bin/dash
AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
#OPTS=-u "$AGENT" -z 1.5
OPTS="-z 1.5"
HISTORY=.rofi-www-history
if [ "$1" = "" ]
then
URL=`cat $HISTORY | rofi -hide-scrollbar -dmenu -p "URL: "`
@grafov
grafov / keybase.md
Created Feb 9, 2017
Prove for keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am grafov on github.
  • I am grafov (https://keybase.io/grafov) on keybase.
  • I have a public key ASAUg76BXpiydF8Zf2e2qaTYNRo1cPkHNvrOB5cK7-Z0DQo

To claim this, I am signing this object:

View workman.php
<?php
// EDIT MY PATH
$file = strtolower(file_get_contents('/Users/YOURUSER/Sites/TEST_TEST.txt'));
function get_points($layout = 'Norman') {
switch ($layout) {
case 'QWERTY':
$points[1] = array('s', 'd', 'f', 'j', 'k', 'l');
@grafov
grafov / synaptics.diff
Created Jun 24, 2014
Patch for synaptics.c for report finger width (still actual for 3.14.3). Taken from http://pastebin.com/rjGyM5pC
View synaptics.diff
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -702,6 +702,8 @@
input_report_abs(dev, ABS_MT_POSITION_X, hw->x);
input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(hw->y));
input_report_abs(dev, ABS_MT_PRESSURE, hw->z);
+ if (hw->w >= 4)
+ input_report_abs(dev, ABS_TOOL_WIDTH, hw->w);
}
View go-template-mode.el
;;; go-template-mode.el --- Major mode for Go template language
;;; Commentary:
;; 1) Copy this file somewhere in your Emacs `load-path'. To see what
;; your `load-path' is, run inside emacs: C-h v load-path<RET>
;;
;; 2) Add the following to your .emacs file:
;;
;; (require 'go-template-mode)
View orgtbl-to-gfm.el
;; Usage Example:
;;
;; <!--- BEGIN RECEIVE ORGTBL ${1:YOUR_TABLE_NAME} -->
;; <!--- END RECEIVE ORGTBL $1 -->
;;
;; <!---
;; #+ORGTBL: SEND $1 orgtbl-to-gfm
;; | $0 |
;; -->
@grafov
grafov / gist:5712165
Created Jun 5, 2013
golang sample of json/rpc over websocket
View gist:5712165
package main
import (
"code.google.com/p/go.net/websocket"
//"github.com/garyburd/go-websocket/websocket"
//"github.com/zhangpeihao/gowebsocket"
"net/http"
"net/rpc"
"net/rpc/jsonrpc"
)
@grafov
grafov / gist:3730213
Created Sep 15, 2012
Send current buffer to server:port
View gist:3730213
(defun tcp-send (server port &optional timeout)
"Отправить текст текущего буфера на server:port"
(if (not timeout) (setq timeout 60))
(let* ((res "*TCP/Result*")
(cur-buf (buffer-name))
(proc (open-network-stream "TcpRequest"
(progn (switch-to-buffer (get-buffer-create res))
(erase-buffer)
(switch-to-buffer cur-buf) res)
You can’t perform that action at this time.