This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
>> sudo python3.3 setup.py install --optimize=1 [11:10:49](master|✔) | |
running install | |
running build | |
running build_py | |
running build_scripts | |
running install_lib | |
creating /usr/local/lib/python3.3/site-packages/ranger | |
copying build/lib/ranger/__init__.py -> /usr/local/lib/python3.3/site-packages/ranger | |
creating /usr/local/lib/python3.3/site-packages/ranger/config | |
copying build/lib/ranger/config/rc.conf -> /usr/local/lib/python3.3/site-packages/ranger/config |
This file contains 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 set-frame-size-according-to-resolution () | |
(interactive) | |
(if window-system | |
(progn | |
(setq width-chars (/ (/ (x-display-pixel-width) (frame-char-width)) 2)) | |
(setq height-lines (- (/ (x-display-pixel-height) (frame-char-height)) 3)) | |
(setq default-frame-alist | |
`((top . 0) (left . 0) | |
(width . ,width-chars) | |
(height . ,height-lines))) |
This file contains 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
#!/bin/bash | |
usage() | |
{ | |
echo "bit operations of two numbers" | |
echo | |
echo "Usage: $(basename $0) NUM1 OPS NUM2 [d]" | |
echo "OPS: a(&, and), o(|, or), x(^, xor), l(<<, left), r(>>, right)" | |
echo "d means result will be dec, default is hex" | |
exit |
This file contains 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
https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt |
This file contains 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
find the files containing the obsolete: | |
such as assoc: | |
find ~/.emacs.d/ -name "*.el" -exec grep -H "(require 'assoc)" {} \; | |
# for the differences of cscope ctags, etags, global(gtags, ggtags..)...: | |
# https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Similar-Tools | |
# etags for small c;cscope for big project |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <signal.h> /* for SIG_ERR */ | |
#include <stddef.h> /* for offsetof */ | |
#include <termios.h> | |
#include <math.h> |
This file contains 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
Source: | |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp | |
png: | |
https://screenshotscdn.firefoxusercontent.com/images/5933b2a1-b14e-4bf9-9790-2259060f006f.png | |
Other source: | |
https://regexr.com/ |
This file contains 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
;; align-regexp with space instead tab | |
(defadvice align-regexp (around align-regexp-with-spaces activate) | |
(let ((indent-tabs-mode nil)) | |
ad-do-it)) | |
(defalias 'ar #'align-regexp) | |
(defadvice align (around align-with-spaces activate) | |
(let ((indent-tabs-mode nil)) | |
ad-do-it)) | |
(defun align-c-comments (beginning end) | |
"Align instances of // or /* */ within marked region." |
This file contains 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 gitco -d 'git checkout -- for multiple files at once' | |
# when you copy/paste using mouse, the strings you pasted are not seprated by space ACTUALLY, using ',' | |
set -l files (echo $argv | tr ',' '\n') | |
for i in $files | |
echo 'git checkout -- for file' $i | |
git checkout -- $i | |
end | |
end | |
function gita -d 'git add for multiple files at once' | |
set -l files (echo $argv | tr ',' '\n') |
OlderNewer