Skip to content

Instantly share code, notes, and snippets.

View kocubinski's full-sized avatar

Matt Kocubinski kocubinski

View GitHub Profile
;; Dynamic form population based on Christophe Grand's suggestions found here:
;; http://bit.ly/72NkNS
(ns dynamic-form
(:refer-clojure :exclude [empty complement])
(:use net.cgrand.enlive-html)
(:import [java.io File]))
(defn populate-select [options]
(fn [node]
@kocubinski
kocubinski / ac-web.el
Last active August 29, 2015 14:02
Auto-complete css class names from CSS files in project
(require 'find-file-in-project)
(defvar css-regexp "\\.\\(-?[_a-zA-Z]+[_a-zA-Z0-9-]*\\)\\s-*{")
(defun parse-css-class-names ()
(make-local-variable 'ffip-patterns)
(setq ffip-patterns '("*.css"))
(let (matches)
(dolist (f (mapcar 'cdr (ffip-project-files)))
@kocubinski
kocubinski / Config.ini
Created December 14, 2011 21:22
Xmonad bindings for bug.n
; bug.n - tiling window management
; @version 8.2.0 (13.12.2011)
; status bar
Config_fontName=Consolas
Config_fontSize=12
Monitor_#1_aView_#2=3
Monitor_#2_aView_#1=3
@kocubinski
kocubinski / xmonad.hs
Created February 23, 2012 23:16
A very, very messy xmonad.hs config file
import XMonad
import XMonad.Layout.LayoutHints
import XMonad.Layout.Grid
import XMonad.Layout.Magnifier
import XMonad.Layout.Circle
import XMonad.Layout.CenteredMaster
import XMonad.Layout.WindowArranger
import XMonad.Layout.IM
import XMonad.Layout.Reflect
import XMonad.Layout.SubLayouts
@kocubinski
kocubinski / oDeskAjax.js
Created July 25, 2012 23:51
A bit of Javascript/JQuery (from oDesk) to manage AJAX page view with history. I really like it.
(function ($) {
"use strict";
$(document).ready(function () {
// !! "casts" if history.pushState is available in the browser, see
// http://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript
var handler, initPage, html5historyEnabled = !! (history.pushState),
loadUrl, timeoutRes = null;
loadUrl = function (url, params) {
var timeout = null;
if (url === "#") {
@kocubinski
kocubinski / reading-list.txt
Created July 26, 2012 18:47
My online reading list
Because for some reason, I hate bookmarks.
On marketing web apps:
http://talsraviv.com/2012/07/26/being-a-developer-makes-you-valuable.-learning-how-to-market-makes-you-dangerous/
Node in emacs:
http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/
Make AJAX # URLs Google crawle-able:
http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html
@kocubinski
kocubinski / clatex.clj
Created November 9, 2012 14:28
Clojure -> Latex using latexmk.
(ns clatex.core
(:import
[System.IO File]))
(def output-file "D:\\mtkoan\\dev\\latex\\kocarc\\clatex_pics.tex")
(def default-picture "D:/mtkoan/dev/latex/default.png")
(def pics-path "D:/mtkoan/dev/latex/kocarc/pics1024/MAK_Prather_Inspection_Pics_")
(def header
@kocubinski
kocubinski / clojure-string-fill.el
Created November 14, 2012 20:41
A emacs fill mode for Clojure to format long (str ...) across multiple lines.
(defun clojure-str-fill ()
(interactive)
(backward-up-list)
(let ((beginning (point)))
(up-list)
(let ((sexp (buffer-substring-no-properties beginning (point))))
(message sexp))))
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace PharmaSeq.Reflection
{
using IndexType = IDictionary<Type, ICollection<Type>>;
/// <summary>
@kocubinski
kocubinski / snip.ahk
Created February 24, 2013 19:53
Autohotkey to automatically snip screen, save file, put file name in clipboard.
SendMode Input
root = C:\mski\Dropbox\org\
picdir = img\
dir = %root%%picdir%
Run, "C:\windows\Sysnative\SnippingTool.exe"
KeyWait, Space, D
InputBox, filename, Enter filename of picture
if ErrorLevel
return