Skip to content

Instantly share code, notes, and snippets.

View CarlasHub's full-sized avatar
🌐
http://carlashub.com/

Carla Goncalves CarlasHub

🌐
http://carlashub.com/
View GitHub Profile
@CarlasHub
CarlasHub / MongoDB keys
Created May 12, 2018 19:34
Installing MongoDB -Cloud9
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
mongo --version
//cd into the root directory ~
mkdir data
echo "mongod --dbpath=data --nojournal" > mongod
chmod a+x mongod
//cd into the root directory ~
// terminal
bundle exec jekyll serve --watch --baseurl ""
@CarlasHub
CarlasHub / restful_routes.md
Created May 14, 2018 20:09 — forked from alexpchin/restful_routes.md
7 Restful Routes
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
@CarlasHub
CarlasHub / git-clearHistory
Created May 20, 2018 23:26 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
killall mongod
sudo apt-get purge -y mongodb-org*
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
note: you may need to run these individually.
When that's done you can restart the terminal (close and open a new one) and run mongo --version it should be 3.6.2
@CarlasHub
CarlasHub / DEV_RESOURCES.md
Created August 19, 2018 21:03 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@CarlasHub
CarlasHub / phpMyAdmin in Homestead
Created October 7, 2018 21:55
How to setup phpMyAdmin in Homestead
How to setup phpMyAdmin in Homestead
By Andrews Ang / Sep 06, 2016 / IT admin, Laravel, Programming, Tutorial, Web
Writing this for my own reference. Hope it helps someone too.
Install using Ubuntu repository:
This will install phpMyAdmin from Ubuntu’s repositories. Assuming that your projects live in /home/vagrant/Code:
On your hosting machine, open a terminal, go to your homestead folder, after “vagrant up”, enter “vagrant ssh” to ssh to your virtual machine.
Then enter “sudo apt-get install phpmyadmin” (Do not select apache2 nor lighttpd when prompted. Just hit tab and enter.)
@CarlasHub
CarlasHub / gulpfile.js
Created December 23, 2018 10:16 — 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');
function url()
{
if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$protocol = 'https://';
} else {
$protocol = 'http://';
}
<?php
/**
* Template Name: blog feed
*/
get_header();
$blogPosts = handleJsonCache(array(
'expirySeconds' => -1,
'fileName' => 'blog-feed'
), function () {