Skip to content

Instantly share code, notes, and snippets.

View cadd's full-sized avatar
💭
yeah

Robert cadd

💭
yeah
View GitHub Profile
@cadd
cadd / gulpfile.js
Created March 17, 2016 14:19 — forked from torgeir/gulpfile.js
Example gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@cadd
cadd / gulpfile.js
Created March 17, 2016 14:20 — forked from mikaelbr/gulpfile.js
Example gulpfile for complete set-up.
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');
@cadd
cadd / gulpfile.js
Created March 17, 2016 14:21 — forked from zwacky/gulpfile.js
Example gulpfile.js to get it going with LESS and AngularJS
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var rimraf = require('rimraf');
var paths = {
less: ['./less/*.less'],
js: ['./js/app/*.js', './js/app/**/*.js'],
jsView: ['./js/app/views/*.html'],
dist: {
css: './public/css/',
@cadd
cadd / doskey.md
Created May 20, 2016 16:22 — forked from vladikoff/doskey.md
Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Saved from Archive.org, Date: May 14, 2010 Author: Jesse Webb

http://web.archive.org/web/20140330024520/http://devblog.point2.com/2010/05/14/setup-persistent-aliases-macros-in-windows-command-prompt-cmd-exe-using-doskey/

Our development machines here at Point2 are not standardized; we have a mixture of Windows XP, 7, and Mac OSX/Unix computers. I find myself constantly switching back and forth between command prompt interfaces when pair programming. As a result, I catch myself using “ls” to list a directories contents regardless of what system I am on. I am currently using a Windows XP machine for my developer box and I wanted to setup an alias to the “ls” command to actually perform a “dir”. Here is how I accomplished it…

There is a command available in a Window’s shell that let’s you “alias” command to whatever you please: DOSKey. It allows you to create “macros” to execute one or more other commands with a custom nam

@cadd
cadd / mongodb_model.py
Created February 1, 2019 09:12 — forked from fatiherikli/mongodb_model.py
Very simple MongoDB Model in Python
from pymongo import Connection
from bson import ObjectId
from itertools import imap
class Model(dict):
"""
A simple model that wraps mongodb document
"""
__getattr__ = dict.get
#!/usr/bin/env bash
echo "
----------------------
NODE & NPM
----------------------
"
# add nodejs 10 ppa (personal package archive) from nodesource
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
echo "
----------------------
MEANIE
----------------------
"
# clone meanie project from github into /opt/meanie folder
sudo git clone https://github.com/cornflourblue/meanie /opt/meanie
# install npm packages for meanie
@cadd
cadd / tools.py
Created April 4, 2019 09:24 — forked from akhenakh/tools.py
flask jsonify with support for MongoDB from tools import jsonify
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
raise ImportError
import datetime
from bson.objectid import ObjectId
from werkzeug import Response
@cadd
cadd / mysql_cheat_sheet.md
Created April 23, 2019 09:10 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@cadd
cadd / app.js
Created May 15, 2019 16:40 — forked from saiumesh535/app.js
error handling in express applicaiton
const express = require('express');
const http = require('http');
const app = express();
app.get('/', (req, res) => {
res.send('Hey!!');
});
app.post('/exceptionRoute', async (req, res) => {