Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@JacobDB
JacobDB / ftp.json
Last active October 2, 2017 14:45
ftp.json for use with my new-site and new-site-static repositories.
{
"dev": {
"host": "",
"user": "",
"pass": "",
"path": ""
},
"dist": {
"host": "",
"user": "",
@JacobDB
JacobDB / wkqx.php
Created March 15, 2016 19:26
Web scraper to convert TuneGenie in to RSS
<?php
$url = "http://wkqx.tunegenie.com/";
$title = "WKQX RSS Feed";
$description = "A constantly updated feed for WKQX's playlist";
$userAgent = "Googlebot/2.1 (http://www.googlebot.com/bot.html)";
header("Content-type: text/xml; charset=utf-8", true);
echo "<?xml version='1.0' encoding='UTF-8' ?>" . PHP_EOL;
echo "<rss version='2.0'>" . PHP_EOL;
// config/db.js
module.exports = {
url : 'mongodb://localhost/acquisition'
}
#!/bin/bash -ue
#Invoice Ninja Self-Hosted Update
#PLEASE SEE THE README AT https://pastebin.com/nwcSH0TH
#SET INVOICE NINJA INSTALL AND STORAGE PATHS
#--------------------------------------------------------
sudo updatedb
ninja_home="$(locate -b '\composer.json' | xargs grep -l "invoiceninja/invoiceninja" | xargs -n 1 dirname)"
ninja_storage="$ninja_home/storage"
# Apache Server Configs v2.14.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ######################################################################
@JacobDB
JacobDB / .gitlab-ci.yml
Last active March 10, 2020 13:38 — forked from RafalSladek/ .gitlab-ci.yml
gitlab ci file for gulp build pipeline with the latest nodejs
image: node:latest
cache:
paths:
- node_modules/
before_script:
- npm install -g gulp
- npm install
@JacobDB
JacobDB / inline-svg-function.scss
Created January 26, 2017 17:45 — forked from B-iggy/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@JacobDB
JacobDB / atom.sh
Last active February 13, 2019 15:42
Alias used to open Atom from within Bash on WSL.
atom() {
target_path=$(wslpath -a -w $(readlink -f $1)) # resolve the path
(/mnt/c/Windows/System32/cmd.exe /C "atom.cmd $target_path" &> /dev/null) # open the path
}
@JacobDB
JacobDB / open.sh
Last active September 27, 2018 20:08
Alias used to open File Explorer from within Bash on WSL.
open() {
target_path=$(wslpath -a -w $(readlink -f $1)) # resolve the path
/mnt/c/Windows/explorer.exe $target_path # open the path
}
@JacobDB
JacobDB / config.php
Last active April 24, 2017 13:43
Example settings for triggering a gulp task when using https://github.com/vicenteguerra/git-deploy
<?php
define('TOKEN', 'some-secret-token');
define('REMOTE_REPOSITORY', 'git@github.com:username/repository.git');
define('DIR','/var/www/repository/');
define('BRANCH','refs/heads/master');
define('LOGFILE', 'log.txt');
define('GIT', '/usr/bin/git');
define('AFTER_PULL', '/usr/bin/node ./node_modules/gulp/bin/gulp.js default --dist');