This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun surround(tag) | |
"Surround content within html TAG. | |
TAG can be <>," ",' ',[ ], etc." | |
(interactive "sWord should be inside: ") | |
(backward-word) | |
(mark-word) | |
(when (region-active-p) | |
(kill-region (region-beginning) (region-end))) | |
(insert tag) | |
(backward-char) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; get IP-address of host or remote | |
;; Ref: EMACS-FU ==> Programming. by: Eric Ludlam | |
(defun get-ip-address (&optional dev) | |
"Get the IP-address for device DEV (default: eth0)" | |
(interactive) | |
(let ((dev (if dev dev "eth0"))) | |
(substring ;; chop the final "\n" | |
(shell-command-to-string | |
(concat | |
"ifconfig " dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mcd() | |
{ | |
# Make and change directory. | |
# Optionally initialize it as a GIT repo. | |
# Copy this function to ~/.bashrc or /etc/profile | |
if [ "$#" -eq 1 ] | |
then | |
echo "Do you want to initialize this as a git repo? " | |
select ynq in "Yes" "No" "Quit"; do | |
case $ynq in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"<p>[' '-z\"!]+</p>" | |
"<address>[\n.[' '-z<>\"!]+</address>$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(request): | |
context=RequestContext(request) | |
# data=[] | |
categories=Category.objects.all() | |
for category in categories: | |
print "%s: %d percent" % (category, category.percent) | |
context_dict = { | |
'categories': categories, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun yh/orgtbl-to-rst-paddings (table) | |
(let* ((pruned-table (remove 'hline table)) | |
(size-table (mapcar (lambda (row) | |
(mapcar #'length row)) | |
pruned-table))) | |
(apply #'mapcar* #'max size-table))) | |
(defun yh/orgtbl-padded-hline (paddings &optional chr) | |
(let ((chr (or chr ?-))) | |
(concat (format "+%c" chr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(if (file-exists-p "/usr/bin/soffice") | |
(setq org-export-odt-convert-processes | |
"/usr/bin/soffice --headless --convert-to %f%x --outdir %d %i" | |
org-export-odt-preferred-output-format "odt" | |
org-export-odt-convert-process "/usr/bin/soffice") | |
(message "SOFFICE path not found")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
# Know the delimiter used(Useful to differentiate between a space and tab). | |
# f = open('test.txt') | |
# lines = f.readlines() | |
# print lines | |
# Uncomment below line to import data from a file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Download source from: https://drive.google.com/file/d/0B-PZvjWWRSpQbldxaFhIR2hEeG8/view?usp=sharing | |
- Extract the file using | |
tar -xvzf v4l2.tar.gz | |
- Visit 'v4l2/libv4l' directory | |
cd v4l2/libv4l | |
make clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/arm 3.4.5 Kernel Configuration | |
# | |
CONFIG_ARM=y | |
CONFIG_HAVE_PWM=y | |
CONFIG_SYS_SUPPORTS_APM_EMULATION=y | |
CONFIG_GENERIC_GPIO=y | |
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set | |
CONFIG_GENERIC_CLOCKEVENTS=y |