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
/* life.c */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SIZE 30 | |
#define ALIVE 1 | |
#define DEATH -1 |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import sys | |
SIZE = int(sys.argv[1]) | |
E = np.eye(SIZE, k=1) + np.eye(SIZE) + np.eye(SIZE, k=-1) | |
world = np.random.randint(2, size=(SIZE, SIZE)) | |
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
(require 'recentf) | |
(require 'dired-open) | |
;;;###autoload | |
(defun my-add-recentf-in-dired () | |
"Add a file to the recentf list when you try to open the file using dired-open.el." | |
(interactive) | |
(let ((file (dired-get-filename))) | |
(when file | |
(recentf-add-file file))) | |
nil) |
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
map <Space>d :duplicate<CR> | |
map U scrollPageUp | |
map D scrollPageDown | |
map <Space>h :help<CR> | |
map <Space>ss :settings<CR> | |
map G scroolToBottom | |
map <C-n> scroolPageDown | |
map <C-p> scroolPageUp | |
map <C-x>2 :duplicate<CR> | |
map <C-x>h :help<CR> |
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
map g2 :duplicate<CR> | |
map U scrollPageUp | |
map D scrollPageDown |
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 open-explorer() | |
(interactive) | |
(start-process-shell-command "open-explorer" nil "start.")) |
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 view-pdf() | |
(interactive) | |
(let ((pdf-file (concat (car (split-string (buffer-file-name) "\\.")) ".pdf")) | |
(viewer pdf-viewer)) | |
(start-process "*view-pdf*" nil viewer pdf-file))) |
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 tweet-current-line() | |
(interactive) | |
(let* ((clbeg (progn (forward-line 0) (point))) | |
(clend (progn (end-of-visible-line) (point))) | |
(tw-string (buffer-substring clbeg clend))) | |
(if (y-or-n-p (format "post \"%s\"?" tw-string)) | |
(progn (twittering-update-status-from-pop-up-buffer tw-string) | |
(twittering-edit-post-status))))) |
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
@echo off | |
set service_name=emacs | |
tasklist | find /i "%service_name%" | |
if %errorlevel%==0 ( | |
echo 1 | |
start emacsclientw something | |
) Else ( | |
echo 2 | |
start runemacs | |
) |
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
Set ws = CreateObject("Wscript.Shell") | |
ws.run "cmd /c myemacs.bat", vbhide |