Skip to content

Instantly share code, notes, and snippets.

View Kevnz's full-sized avatar
💭
Writing the code

Kevin Isom Kevnz

💭
Writing the code
View GitHub Profile
@Kevnz
Kevnz / a_mongodb_to_s3_backup.sh
Created February 12, 2016 10:29 — forked from lazarofl/a_mongodb_to_s3_backup.sh
MongoDB Automatic Backup to Amazon S3 with Crontab and s3cmd. Red Hat Linux on Amazon EC2
#!/bin/bash
#Force file syncronization and lock writes
mongo admin --eval "printjson(db.fsyncLock())"
MONGODUMP_PATH="/usr/bin/mongodump"
MONGO_HOST="prod.example.com"
MONGO_PORT="27017"
MONGO_DATABASE="dbname"
/** @jsx React.DOM */
var SVGComponent = React.createClass({
render: function() {
return this.transferPropsTo(
<svg>{this.props.children}</svg>
);
}
});
@Kevnz
Kevnz / better-nodejs-require-paths.md
Created October 10, 2015 07:29 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@Kevnz
Kevnz / gulpfile.js
Created October 2, 2015 01:10 — forked from Sigmus/gulpfile.js
gulpfile.js with browserify, reactify, watchify and gulp-notify.
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
var gulp = require('gulp');
var browserify = require('browserify');
var notify = require('gulp-notify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
var csso = require('gulp-csso');
var watch = require('gulp-watch');
var envify = require('envify');
@Kevnz
Kevnz / exercise.js
Last active August 29, 2015 14:21 — forked from ryanflorence/exercise.js
import React from 'react'
import assign from 'object-assign'
var styles = {}
class Autocomplete extends React.Component {
static propTypes = {
initialValue: React.PropTypes.any,
onChange: React.PropTypes.func,
@Kevnz
Kevnz / spots.json
Created February 27, 2015 19:39
Vacation points of interest
{
"api": "AIzaSyAMIrimQdk3qTEG1nWC3dCW36gCwUKZiyg",
"locations": [
{
"name": "Broadway Show",
"lat":40.756111,
"lng":-73.987934
},
{
"name": "American Museum of Natural History",
@Kevnz
Kevnz / index.js
Created October 14, 2014 17:36
requirebin sketch
// example using the raf module from npm. try changing some values!
document.body.innerHTML ='<div class="wrapper"><div class="btn-morph"> <a class="pure-button pure-button-confirm" href="#">Do Something</a></div></div><link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">';
var morph = require('dom-morph');
var delegate = require('delegate-dom')
var addClass = function (el, className) {
if (el.classList) {
el.classList.add(className);
} else {
@Kevnz
Kevnz / index.js
Created October 14, 2014 17:35
requirebin sketch
// example using the raf module from npm. try changing some values!
document.body.innerHTML ='<div class="wrapper"><div class="btn-morph"> <a class="pure-button pure-button-confirm" href="#">Do Something</a></div></div><link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">';
var morph = require('dom-morph');
var delegate = require('delegate-dom')
var addClass = function (el, className) {
if (el.classList) {
el.classList.add(className);
} else {