Skip to content

Instantly share code, notes, and snippets.

View natural's full-sized avatar
🏍️
prefiero estar manejando mi moto

Troy Melhase natural

🏍️
prefiero estar manejando mi moto
View GitHub Profile
@natural
natural / pc
Last active July 26, 2023 14:03
page count
#!/usr/bin/env python
from argparse import ArgumentParser, ArgumentTypeError
from subprocess import check_output
from sys import exit, stdout
def format_count(count, scale):
return f'%.{scale}f' % count
@natural
natural / nifi-checkstyle.xml
Last active April 13, 2020 19:10 — forked from alopresto/nifi-checkstyle.xml
NiFi checkstyle rules for IntelliJ IDEA.
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8" />
<property name="severity" value="warning" />
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
@natural
natural / datomic-helpers.clj
Created April 24, 2018 23:39 — forked from bobby/datomic-helpers.clj
Some Datomic helpers I sometimes use with ring or pedestal-service apps
(ns datomic-helpers
(:require [datomic.api :as d]))
;;; Expose Datomic vars here, for convenience
;;; Ring middleware
(defn wrap-datomic
"A Ring middleware that provides a request-consistent database connection and
value for the life of a request."
@natural
natural / datomic-helpers.clj
Created April 24, 2018 23:39 — forked from terjesb/datomic-helpers.clj
Some Datomic helpers I use with Ring apps
(ns datomic-helpers
(:require [clojure.java.io :as io]
[clojure.walk :as walk]
[datomic.api :as d :refer (db)]))
;;; Expose Datomic vars here, for convenience
(def tempid d/tempid)
(def connect d/connect)
(def create-database d/create-database)

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@natural
natural / handler.clj
Created October 23, 2017 16:34 — forked from ikitommi/handler.clj
2-way spec coercion
(ns handler
(:require [clj-time.core :as t]
[clj-time.coerce :as t.c]
[spec-tools.conform :as conform]
[clojure.spec.alpha :as s]
[spec-tools.core :as st]
[compojure.api.sweet :refer :all]
[ring.util.http-response :refer :all]))
(def timestamp
@natural
natural / reserved-words.txt
Created November 28, 2015 06:43 — forked from zachrose/reserved-words.txt
URL paths to reserve in a web app
about
admin
blog
calendar
contact
copyright
dashboard
email
errors
events
// http://play.golang.org/p/i5L__nrXyA
package main
import (
"fmt"
"log"
"time"
)
// change this to your local time zone name.
@natural
natural / http.go
Created December 12, 2013 17:36 — forked from bmizerany/http.go
package main
func main() {
// ... setup ...
l, err := net.Listen("tcp", *laddr)
if err != nil {
log.Fatal(err)
}
@natural
natural / gist:6407668
Created September 1, 2013 22:14
example j2py config file to throw away interfaces when generating python code
from java2python.config.default import astTransforms
from java2python.lang.selector import Type
from java2python.lang import tokens
interfaces = []
def throwAwayInterface(node, config):
interfaces.append(node.firstChildOfType(tokens.IDENT).text)
node.parent.children.remove(node)