Skip to content

Instantly share code, notes, and snippets.

View carnevlu's full-sized avatar

Luca Carnevale carnevlu

View GitHub Profile
@carnevlu
carnevlu / brew.sh
Created June 12, 2018 15:09
OSX Brew
#!/bin/bash
printeval() { test $# -gt 0 && echo $@ && eval $@; }
upstall() { type -P $1 || printeval $2 && printeval $3; }
addset() { grep -q "^$1" $3 && sed -i "" "s/^$1.*/$1=$2/" $3 || echo "$1=$2" >> $3; }
xcode-select --install
upstall brew 'ruby -e "$(curl -s https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew tap caskroom/cask'
upstall subl 'brew cask install sublime-text-dev && brew cask install subl'
upstall alcatraz 'brew cask install alcatraz'

Keybase proof

I hereby claim:

  • I am carnevlu on github.
  • I am carnevlu (https://keybase.io/carnevlu) on keybase.
  • I have a public key whose fingerprint is 43AD 2B36 934C 942B 3B7E D2EF 89A5 1E03 4686 F715

To claim this, I am signing this object:

@carnevlu
carnevlu / install-CB-import-Fields-Layouts-Templates.php
Last active May 18, 2022 09:08
MODX install package __ContentBlock__ and import Fields,Layouts,Templates from multiple export files
<?php
define('MODX_API_MODE', true);
// Full path to the index
require_once('index.php');
$modx = new modX();
$modx->initialize('mgr');
######################## Variables
@carnevlu
carnevlu / _service.md
Created November 23, 2016 15:46 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)