Skip to content

Instantly share code, notes, and snippets.

View teone's full-sized avatar

Matteo teone

  • Intel
  • San Francisco
View GitHub Profile
@teone
teone / images-diff.sh
Last active May 4, 2020 18:46
check the commits between two images in the opencord repo
images=( "$@" )
commits=()
if [ ${#images[@]} != 2 ]
then
printf "You need to provide two images only, eg:\n"
printf "\tbash $0 voltha/voltha-rw-core:2.3.6 voltha/voltha-rw-core:2.4.0\n"
exit 1
fi
@brennanMKE
brennanMKE / hero.ts
Last active April 1, 2024 16:16
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@teone
teone / Gruntfile.js
Last active August 29, 2015 14:10
Basic Grunt configuration for compass and livereload
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['sass/*.scss'],
tasks: ['compass'],
options: {
@edy
edy / angular-directive-navmenu.js
Last active May 30, 2018 04:16
AngularJS directive to mark navigation menu items as active
'use strict';
// <ul nav-menu="active">
// <li><a href="/one">Page One</a></li>
// <li><a href="/two">Page Two</a></li>
// <li><a href="/three">Page Three</a></li>
// </ul>
app.directive('navMenu', function($location) {
return function(scope, element, attrs) {
@cobyism
cobyism / gh-pages-deploy.md
Last active May 6, 2024 08:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).