Skip to content

Instantly share code, notes, and snippets.

View nickfun's full-sized avatar

Nick F nickfun

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Web Page</title>
<meta charset="utf-8">
<link href="css/grid.css" type="text/css" rel="stylesheet" media="screen"/>
<style>
/* local style */
</style>
<script src="js/lib/jquery.js"></script>
@nickfun
nickfun / gist:5428231
Last active December 16, 2015 11:29
Recursive print for Javascript.
function print_r( data, key, level ) {
if( key !== 0 ) {
key = key || false;
}
level = level || 0;
if( _.isArray( data ) ) {
if( typeof key === 'boolean' ) {
print_r('[', false, level);
} else {
print_r(key + ': [', false, level);
@nickfun
nickfun / scratch.html
Last active December 24, 2015 03:29
page scratch
<!doctype html>
<html>
<head>
<title>Scratch</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.js"></script>
<script src="./test.js"></script>
</head>
<body>
<h1>Scratch</h1>
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Nick Fun'
SITENAME = u'Implementation Specific'
SITEURL = 'https://nickfun.github.io'
DISQUS_SITENAME = 'nickfun'
PATH = 'content'
@nickfun
nickfun / gist:0612a97b934ba810e9f5
Created November 25, 2014 00:50
Dropwizard cookie example
import javax.ws.rs.core.Response;
import javax.ws.rs.core.NewCookie;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
public class MyResource {
@GET
@Path("/")
public Response getPage() {
PageView myView = new PageView();
@nickfun
nickfun / gist:1e4576dcbba42a9c8c8e
Created November 25, 2014 23:33
Emacs Backtrace on HTML Export
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("[012]?[0-9]:[0-5][0-9]\\(-\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)" nil)
org-element-timestamp-parser()
org-element-clock-parser(169440)
org-element--current-element(169440 nil nil nil)
org-element--parse-elements(168186 169440 nil nil nil nil (section (:begin 168186 :end 169440 :contents-begin 168186 :contents-end 169440 :post-blank 0) (clock (:status closed :value (timestamp (:type inactive-range :raw-value "[2014-05-27 Tue 17:46]--[2014-05-27 Tue 18:26]" :year-start 2014 :month-start 5 :day-start 27 :hour-start 17 :minute-start 46 :year-end 2014 :month-end 5 :day-end 27 :hour-end 18 :minute-end 26 :begin 168196 :end 168243 :post-blank 1)) :duration "0:40" :begin 168186 :end 168252 :post-blank 0 :parent #0)) (clock (:status closed :value (timestamp (:type inactive-range :raw-value "[2014-05-27 Tue 10:00]--[2014-05-27 Tue 10:47]" :year-start 2014 :month-start 5 :day-start 27 :hour-start 10 :minute-start 0 :year-end 2014 :mon
// for dropwizard 0.7
import io.dropwizard.views.View;
public class BaseView extends View {
protected static final int nocache;
static {
nocache = (int) (new Date().getTime() / 1000);
}
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
(quote
("c5a044ba03d43a725bd79700087dea813abcb6beb6be08c7eb3303ed90782482" "e56f1b1c1daec5dbddc50abd00fcd00f6ce4079f4a7f66052cf16d96412a09a9" "6a37be365d1d95fad2f4d185e51928c789ef7a4ccf17e7ca13ad63a8bf5b922f" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "923faef2c7ed017e63f517703c846c6190c31400261e8abdb1be06d5b46ea19a" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "fb4bf07618eab33c89d72ddc238d3c30918a501cf7f086f2edf8f4edba9bd59f" "4c9ba94db23a0a3dea88ee80f41d9478c151b07cb6640b33bfc38be7c2415cc4" default)))
'(dired-listing-switches "-alFh")
'(ediff-diff-options "-w")
;;
;; FizzBuzz in emacs lisp
;;
(defun nf/fb (num)
(cond
((and
(= 0 (% num 3))
(= 0 (% num 5))) "fizzbuzz")
((= 0 (% num 3)) "fizz")
12 TO THE MOON with short: DESIGN FOR DREAMING
AGENT FOR H.A.R.M.
ALIEN FROM L.A.
ANGELS' REVENGE
ATTACK OF THE GIANT LEECHES with short: UNDERSEA KINGDOM PT 1
ATTACK OF THE THE EYE CREATURES
BEING FROM ANOTHER PLANET
BLOOD WATERS OF DR. Z
BLOODLUST with short: UNCLE JIM'S DAIRY FARM
BOGGY CREEK II