I hereby claim:
- I am compro-prasad on github.
- I am compro (https://keybase.io/compro) on keybase.
- I have a public key ASAbZ-8jCEIxy81B9zVVjD4UY2EbETL8yK0LA-HO6YqCFQo
To claim this, I am signing this object:
(defun compro/print-message (event) | |
"This function runs when you click the text." | |
(interactive "e") | |
(message "Hello World")) | |
(let* ((str "Click Me") ;; The text that will be produced | |
(str-beg 0) ;; Start position of string | |
(str-end (string-width str)) ;; End position of string | |
(map (make-sparse-keymap))) ;; Click event will be registered here | |
(define-key map [mouse-1] 'compro/print-message) ;; Register click event |
# Requirement: astyle version 3.1 | |
# 2 space indents. | |
--indent=spaces=2 | |
--indent-after-parens | |
--indent-col1-comments | |
--style=gnu |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
for i in `ls -- *.ppm`; do | |
echo -n Converting $i ... ' ' | |
convert -- $i `echo $i | sed "s/.ppm/.png/"` | |
echo Done | |
done |
(defun copy-current-line-position-to-clipboard (p) | |
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'" | |
(interactive "sAbsolute path y/n?: ") | |
(let ((path-with-line-number) (file-name (buffer-file-name))) | |
(when (and (not (string= p "y")) (projectile-project-root)) | |
(setq file-name (file-relative-name buffer-file-name (projectile-project-root))) | |
) | |
(setq path-with-line-number (concat file-name ":" (number-to-string (line-number-at-pos)))) | |
(x-select-text path-with-line-number) | |
(message (concat path-with-line-number " copied to clipboard")))) |
[ | |
{ "keys": ["ctrl+pagedown"], "command": "next_view" }, | |
{ "keys": ["ctrl+pageup"], "command": "prev_view" } | |
] |
#!/usr/bin/python3 | |
import socket | |
import threading | |
from time import sleep | |
max_peers = 4 | |
port = 3333 | |
thread_list = [] |
#!/bin/sh | |
if which apt > /dev/null; then | |
echo "No support for your device" | |
exit | |
fi | |
if which firefox > /dev/null; then | |
echo "Firefox found" | |
BROWSER=firefox | |
elif which chromium > /dev/null; then |
/*= compile: g++ -std=c++11 -Wall $src -o $exe =*/ | |
/*= run: $exe =*/ | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <cassert> | |
using namespace std; |
# http://python-social-auth.readthedocs.io/en/latest/configuration/settings.html?highlight=SOCIAL_AUTH_UID_LENGTH#tweaking-some-fields-length | |
# Thanks to knbk on #django freenode IRC | |
SOCIAL_AUTH_UID_LENGTH = 190 | |
SOCIAL_AUTH_NONCE_SERVER_URL_LENGTH = 190 | |
SOCIAL_AUTH_ASSOCIATION_SERVER_URL_LENGTH = 190 | |
SOCIAL_AUTH_ASSOCIATION_HANDLE_LENGTH = 190 | |
SOCIAL_AUTH_EMAIL_LENGTH = 190 # More than 190 is very rare to be used |