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
<html> | |
<head> | |
<title>Node.js Zoo Chat</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('form#send').submit(onSend); | |
longPoll(); | |
$('#nickname').focus(); | |
}); |
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 powerline-evil-center-color-theme () | |
"Powerline's center-evil them with the evil state in color." | |
(interactive) | |
(setq-default mode-line-format | |
'("%e" | |
(:eval | |
(let* ((active (powerline-selected-window-active)) | |
(mode-line (if active 'mode-line 'mode-line-inactive)) | |
(face1 (if active 'powerline-active1 'powerline-inactive1)) | |
(face2 (if active 'powerline-active2 'powerline-inactive2)) |
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
;; ------------------------------------------------------------------------------------------------------------------------- | |
;; Neo tree open xdg on point helpers | |
;; ------------------------------------------------------------------------------------------------------------------------- | |
(defun neotree-open-xdg-on-point () | |
"Open a file under point." | |
(interactive) | |
(call-process "xdg-open" nil 0 nil | |
(neo-buffer--get-filename-current-line))) | |
;; Add "o" as the key that will launch the function |
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
(global-set-key [f5] | |
(lambda () | |
(interactive) | |
(save-window-excursion | |
(async-shell-command (concat "urxvt -e run_any.py " default-directory " " (buffer-name)))))) |
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
#!/usr/bin/env python2 | |
import doctest | |
def shift_zeros(line): | |
no_zeros = [each for each in line if each != 0] # make a list with no zeroes | |
return no_zeros + ([0] * (len(line) - len(no_zeros))) # return the list with the zeroes added at the end | |
def merge(line): |
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
def sprite_sheet(size, file_name, pos=(0, 0)): | |
"""Loads a sprite sheet. | |
(tuple(num, num), string, tuple(num, num) -> list | |
This functions cuts the given image into pieces(sprites) and returns them as a list of images. | |
WARNING!!! It needs the pygame library to be imported and initialised to work. | |
Basically this piece of code is to be used preferably within an existing program. | |
size is the size in pixels of the sprite. eg. (64, 64) sprite size of 64 pixels, by 64 pixels. | |
file_name is the file name that contains the sprite sheet. preferable format is png. | |
pos is the starting point on the image. eg. (10, 10) think about it as an offset. |