Skip to content

Instantly share code, notes, and snippets.

@caiorss
caiorss / jdk_download.sh
Last active September 16, 2015 20:03 — forked from P7h/jdk_download.sh
Commands / shell script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt.
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@caiorss
caiorss / programming_language_selection.txt
Created July 12, 2015 06:25
Programming Language Selection Guidelines
* IDE Support
* Community Size
* Documentation, Documentation Generators
* FFI (Foreign Function Interface) for C/C++
* Libraries
* GUI Toolkits
* Multicore and Multitask
* Available Manpower
@caiorss
caiorss / macros.el
Last active September 14, 2022 00:18
Emacs Lisp/Elisp Macro Examples
;; Elisp session in REPL IELM
;;
;;
;;
ELISP> (defmacro inc (var)
(list 'setq var (list '1+ var)))
inc
ELISP> (setq x 0)
0 (#o0, #x0, ?\C-@)
@caiorss
caiorss / dbg.el
Last active August 29, 2015 14:24 — forked from pervognsen/dbg.el
(require 'cl)
(require 'peg)
(defcustom dbg-mi-process-name "dbg-mi" "")
(defcustom dbg-mi-buffer-name "*dbg-mi*" "")
(defvar dbg-mi-process nil)
(defvar dbg-mi-buffer nil)
;;; how to use
;; (add-hook 'html-mode-hook 'django-kyr-tag-mode)
;;(util-macro-install "dkt:")
;;; how to use
;; (add-hook 'html-mode-hook 'django-kyr-tag-mode)
;;(util-macro-install "dkt:")
(eval-when-compile (require 'cl))
;; This macro creates new compilation commands
(defmacro ff/add-compilation-command (name &optional key)
(let ((buffer-name (concat "*" name "*"))
(compile-symbol (intern name))
(recompile-symbol (intern (concat "re" name))))
(when (fboundp compile-symbol)
(warn "redefining command `%s'" name))
(when (fboundp recompile-symbol)
(warn "redefining command `re%s'" name))
`(progn
(defmacro create-scratch-buffer (name &optional comment body)
"Create a new custom scratch buffer. The name should be a valid major mode name without -mode suffix.
The body should be lambda block or a symbol of function that be invoked after a scratch buffer created. nil is accepted to turn it off."
`(defun ,(intern (concat "scratch-" name))
()
(interactive)
(let ((bufname (concat "*scratch-" ,name "*")))
(if (buffer-live-p (get-buffer bufname))
(switch-to-buffer bufname)
(with-current-buffer (get-buffer-create bufname)
(defmacro fmt (str)
"Elisp string interpolation.
Example:
(fmt \"My name is #{user-full-name}, I am running Emacs #{(if (display-graphic-p) \\\"with a GUI\\\" \\\"in a terminal\\\".)}\""
(let ((exprs nil))
(with-temp-buffer
(insert str)
(goto-char 1)
@caiorss
caiorss / init.el
Last active August 29, 2015 14:24 — forked from zonuexe/init.el
;; -*- Mode: Emacs-Lisp ; Coding: utf-8 -*-
;; for Emacs 24
;;; modes(UI)
(tool-bar-mode -1)
(when (and window-system (>= emacs-major-version 23))
(set-face-attribute 'default nil
:family "Migu 2M"
:height 160))
;; Scratch
;; This program helps keep a record of ideas.
;; Last edit: 2012-07-05
;; Every time (scratch) is called a new buffer is opened. Title
;; is today's date appended before a user inputed title.
;Needed features
;* An interactive shell that shows me a list of entries
; from a certain time period.