Skip to content

Instantly share code, notes, and snippets.

View underhilllabs's full-sized avatar

Bart Lantz underhilllabs

View GitHub Profile
@underhilllabs
underhilllabs / bin_to_hex.py
Created February 5, 2011 20:48
binary to hex converter
# binary to hexidecimal
def bin_to_hex(num):
total = ""
subtotal = 0
i = 0
numstr = str(num)
while(numstr):
# foreach digit of the nibble (4 binary digits) translate into single hex digit
# start from least sig digit
subtotal = 0
@underhilllabs
underhilllabs / bin_to_oct.py
Created February 5, 2011 21:28
binary to octal conversion
# binary to oct
def bin_to_oct(num):
total = ""
subtotal = 0
numstr = str(num)
while(numstr):
# foreach digit of the nibble (3 binary digits) translate into single oct digit
# start from least sig digit
subtotal = 0
# pad front of numbers with 0's to fill to 4 bits
@underhilllabs
underhilllabs / color-theme-seamus-magit.el
Created May 16, 2011 05:06
magit section for emacs color theme
;; magit stuff!!
(magit-file-header ((t (:foreground "violet"))))
(magit-hunk-header ((t (:foreground "blue"))))
(magit-header ((t (:foreground "cyan"))))
(magit-tag-label ((t (:background "blue" :foreground "orange"))))
(magit-diff-add ((t (:foreground "MediumSlateBlue"))))
(magit-diff-del ((t (:foreground "maroon"))))
(magit-item-highlight ((t (:background "#000012"))))
@underhilllabs
underhilllabs / add-speech-search.html
Created May 17, 2011 01:40
add speech to search form
<input type="text" x-webkit-speech speech />
@underhilllabs
underhilllabs / color-theme-leuven-org-section.el
Created May 17, 2011 16:11
orgmode variables for an emacs color theme from color-theme-leuven.el
;; Org
(org-agenda-clocking ((t ,clock-line)))
(org-agenda-column-dateline ((t (:inherit org-column))))
;; (org-agenda-column-dateline ((t (:background "deep sky blue" :height 79 :family "Consolas"))))
(org-agenda-current-time ((t (:weight bold :underline t :foreground "purple"))))
(org-agenda-date ((t (:height 1.6 :weight bold :foreground "#0063F5")))) ; "#87C9FC"
(org-agenda-date-today ((t (:height 1.6 :weight bold :foreground "purple")))) ; "#CCCCFF" ; inherit
(org-agenda-date-weekend ((t (:height 1.6 :weight bold :foreground "dim gray")))) ; "#B6B2AE" ; inherit
(org-agenda-diary ((t (:weight bold :foreground "green4" :background "light blue"))))
(org-agenda-dimmed-todo-face ((t (:foreground "gold2")))) ; org-blocked-todo
@underhilllabs
underhilllabs / mu_bartik.inc
Created December 1, 2011 03:37
major ursa color scheme for Bartik theme
ursa' => array(
'title' => t('Ursa Major'),
'colors' => array(
'top' => '#300A24',
'bottom' => '#300A24',
'bg' => '#fffdf7',
'sidebar' => '#edede7',
'sidebarborders' => '#e7e7e7',
'footer' => '#2c2c28',
'titleslogan' => '#ffffff',
@underhilllabs
underhilllabs / org-link-to-textile.el
Created January 8, 2012 20:46
Emacs Macro to change an Org-mode link to a textile link
@underhilllabs
underhilllabs / generate-drupal-tags.sh
Created January 16, 2012 02:19
how to generate a TAGS file with ctags for drupal
ctags --langmap=php:.engine.inc.module.theme.php --php-kinds=cdfi --languages=php --recurse
@underhilllabs
underhilllabs / drush-site-alias.el
Created February 6, 2012 01:18
Add a Drush alias in Emacs
(defcustom drush-default-alias-file "~/.drush/aliases.drushrc.php"
"Default drush configuration directory."
:type 'string
:group 'drupal)
(defun drupal-drush-alias-add (name uri root)
"Add an alias to the drush aliases file in a buffer."
(interactive "sAlias Name: \nsURI: \nsRoot: ")
(drupal-drush-process-alias-file drush-default-alias-file name uri root))
@underhilllabs
underhilllabs / chatclient.el
Created February 15, 2012 06:06
Connect to Chatserver from Emacs
;; set the port of the Chat Server
(defvar port 1337)
;; set the host of the Chat Server
(defvar host "localhost")
(defun my-chat ()
"Chat client for chat server assignment"
(interactive)
;; open-network-stream creates a socket to the Chat Server