Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🎯
Focusing

Chris Baughman cmbaughman

🎯
Focusing
View GitHub Profile
@coilysiren
coilysiren / install.bash
Last active July 8, 2020 15:24
Installing Django CMS on Digital Ocean (March 7th 2016)
# from inside the top level project folder (ie. where .git/, Procfile, etc lives)
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev git python3.4 python3.4-dev -y
virtualenv -p python3.4 .venv && source .venv/bin/activate
pip install -e git+https://github.com/nephila/djangocms-installer#egg=djangocms-installer
pip install "django-cms<3.3" "django-treebeard>=2.0" "https://github.com/divio/djangocms-column/archive/master.zip?1457384272.4600909" "https://github.com/divio/djangocms-googlemap/archive/master.zip?1457384272.4600909" "https://github.com/divio/djangocms-inherit/archive/master.zip?1457384272.4600909" "https://github.com/divio/djangocms-link/archive/master.zip?1457384272.4600909" "https://github.com/divio/djangocms-style/archive/master.zip?1457384272.4600909" "easy_thumbnails" "django-filer>=0.9.12" "cmsplugin-filer>=0.10.2" "djangocms-admin-style>=1.0.6" "djangocms-text-ckeditor>=2.8.1" "Django<1.9" "pytz" "django-reversion>=1.8.7,<1.9" "django-classy-tags>=0.3.4.1" "html5lib"
@alces
alces / ansible_local_playbooks.md
Last active August 20, 2025 22:09
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@morsok
morsok / referer.php
Last active February 28, 2022 10:22
Drupal 8 : Do something based on the referer if it's your website or another.
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
function my_function() {
$previousUrl = \Drupal::request()->server->get('HTTP_REFERER');
$fake_request = Request::create($previousUrl);
$url_object = \Drupal::service('path.validator')->getUrlIfValid($fake_request->getRequestUri());
if ($url_object) {
$route_name = $url_object->getRouteName();
// Do something with $route_name;
@bsara
bsara / git-ssh-auth-win-setup.md
Last active July 28, 2025 00:31
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@takikoo
takikoo / README.md
Last active November 8, 2024 21:08
Export bookmarks from Google Chrome with a batch script

Export chrome bookmarks

This is a script to export bookmarks from the web browser Google Chrome to a users home drive in a Windows environment with clients and domain controllers. Most of the script comes from this article

Instruction

  • Double-click on the bat-file.
  • Go the home drive on the users new computer.
  • Double-click on openChromeFolder.bat which will take you to the chrome directory on that machiene.
  • Copy the file Bookmarks to the newly opened window.

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@cmbaughman
cmbaughman / JsExportCSV.js
Created April 10, 2017 22:35
JavaScript to export a CSV
// Originally found on
//https://appendto.com/2017/04/use-javascript-to-export-your-data-as-csv/
function convertArrayOfObjectsToCSV(args) {
        var result, ctr, keys, columnDelimiter, lineDelimiter, data;
        data = args.data || null;
        if (data == null || !data.length) {
            return null;
        }
@cmbaughman
cmbaughman / gulp-drupal-theme
Created July 1, 2017 22:34 — forked from zetagraph/gulp-drupal-theme
gulp drupal theme
var gulp = require("gulp");
var sass = require("gulp-sass");
var filter = require('gulp-filter');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require("browser-sync");
var reload = browserSync.reload;
var shell = require('gulp-shell');
// sass task
gulp.task('sass', function () {
@cmbaughman
cmbaughman / drupal8.preinstall.mysql.sql
Created July 19, 2017 17:36
Create Drupal 8 Database MySQL
CREATE DATABASE database CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER username@localhost IDENTIFIED BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';