Skip to content

Instantly share code, notes, and snippets.

Avatar
🌵
On a vision quest

Darren DarrenN

🌵
On a vision quest
View GitHub Profile
@DarrenN
DarrenN / get-npm-package-version
Last active Sep 7, 2021 — forked from yvele/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@DarrenN
DarrenN / shortid.rb
Created Nov 20, 2011
Short unique ID (Ruby)
View shortid.rb
t = DateTime
id = t.now.strftime("%Y%m%d%k%M%S%L") # Get current date to the milliseconds
id = id.to_i.to_s(36) # will generate somthing like "5i0sp1h4tkc"
# Reverse it
id.to_i(36)
@DarrenN
DarrenN / codereviews.md
Last active Apr 13, 2021
How do you perform code reviews?
View codereviews.md

How do you perform Code Reviews?

http://stackoverflow.com/questions/310813/how-do-you-perform-code-reviews

How are code reviews performed on your development team?

I've been a developer for several years now in several different companies and I have noticed that there isn't a consistent approach to performing code reviews.

At my current company, code reviews are non-existent, which has led to a significant decrease in the quality of the code. At previous jobs, code reviews ranged from just making sure coding standards were enforced to nazi-like line by line reviews that took days to complete.

So I'm wondering what its like for everyone else out there. And in particular, what tools do you use to perform the reviews? And do you find that code reviews help rather than add to the length of time needed for a given project?

@DarrenN
DarrenN / .gitignore
Last active May 11, 2020 — forked from avescodes/Editing Clojure with Emacs
Emacs setup for Clojure
View .gitignore
shibuya.el
dazza.el
elpa/
places
eshell/
.smex-items
ac-comphist.dat
projectile-bookmarks.eld
@DarrenN
DarrenN / stop_words.txt
Created Jan 29, 2011
Naively parse a text removing stopwords
View stop_words.txt
'tis
'twas
a
aah
aaron
abandon
abandoned
abbott
abby
abe
@DarrenN
DarrenN / net-lens.rkt
Created Jan 21, 2018
Fun with Lenses, structs and net/url in Racket
View net-lens.rkt
#lang racket/base
(require json
lens
net/url
net/url-string
net/head
racket/dict
racket/string)
@DarrenN
DarrenN / LiftFunctorDataThing.js
Created Sep 14, 2018
Pull a field from an object and set the object to the value of that field in a new object
View LiftFunctorDataThing.js
// needs ramda.js
const enclose = curry((a, obj) => objOf(prop(a, obj))(obj))
var example = {'id': '123', 'foo': 'bar'};
enclose('id', example)
// {"123": {"foo": "bar", "id": "123"}}
@DarrenN
DarrenN / logging.rkt
Created May 13, 2018 — forked from Metaxal/logging.rkt
Simple usage of Racket's logging facility
View logging.rkt
#lang racket/base
; One way to define a logger
(define lg (make-logger 'my-logger))
; Define a receiver for this logger, along with a log level
(define rc (make-log-receiver lg 'error)) ; also try with 'debug
; Another way to define a logger, with additional forms
(define-logger lg2)
(define rc2 (make-log-receiver lg2-logger 'debug))
@DarrenN
DarrenN / trace.log-rkt
Created Sep 1, 2017 — forked from greghendershott/trace.log-rkt
Make racket/trace output go to a logger
View trace.log-rkt
#lang racket/base
(require racket/format
racket/list
racket/match
racket/trace)
(provide (all-defined-out)
(all-from-out racket/trace))
@DarrenN
DarrenN / app.jsx
Created Jul 14, 2015
Use Material Design Lite's JS to handle layouts with React + Webpack
View app.jsx
/* jshint esnext:true */
'use strict';
import React from 'react';
import Header from './header';
import Workspace from './workspace';
import Footer from './footer';
// Manually call upgradeElement / MaterialLayout on the main layout div *AFTER* its been rendered in the DOM.
export default React.createClass({