Skip to content

Instantly share code, notes, and snippets.

View OwenMelbz's full-sized avatar

Owen Melbourne OwenMelbz

View GitHub Profile
@OwenMelbz
OwenMelbz / lightmode.js
Created May 20, 2021 08:59
Node CLI tool to disable darkmode on specific apps
#!/usr/bin/env node
const path = require('path')
const { execSync } = require('child_process')
/*
* You can symlink this to a bin dir e.g. "ln -s /Users/owen/lightmode.js /usr/local/bin/lightmode"
* To enable lightmode for an app, simply pass the full path to the application to lightmode e.g.
*
* lightmode /Application/Google\ Chrome.app
*
const defaults = require('./scripts/tailwind.defaults');
module.exports = defaults({
theme: {},
})
@OwenMelbz
OwenMelbz / Compile to CJS .js file .js
Last active June 14, 2020 13:54
Compile Tailwind CSS Programatically
const fs = require('fs')
const postcss = require('postcss')
const tailwind = require('tailwindcss')
const source = `
@tailwind components;
@tailwind utilities;
`
function toJson(node, json) {
@OwenMelbz
OwenMelbz / .babelrc
Last active May 22, 2020 08:49
Adds className support to React Native for Tailwind CSS Only
{
"plugins": ["./transformwind.js"]
}
@OwenMelbz
OwenMelbz / \etchosts
Created March 4, 2020 21:12
blitz.gg ad block hosts
# Blitz Adverts
127.0.0.1 hotjar.com tpc.googlesyndication.com pixel.adsafeprotected.com ams1-ib.adnxs.com 2mdb.net s0.2mdb.net s1.2mdb.net s2.2mdb.net s3.2mdb.net
@OwenMelbz
OwenMelbz / check.php
Last active March 4, 2020 20:44
Lets Encrypt Forge Check
<?php
//
// First composer require themsaid/forge-sdk
//
use Themsaid\Forge\Forge;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Themsaid\Forge\Resources\Server;
@OwenMelbz
OwenMelbz / Api.js
Last active May 1, 2019 17:14
Twitter Clone Helpers
import faker from 'faker';
export default class Api
{
data = [];
_generateTweets(number = null) {
number = number || faker.random.number({ min: 1, max: 5 });
const items = [];
@OwenMelbz
OwenMelbz / NovaWatcher.js
Last active April 17, 2019 21:36
A single Laravel Mix for all your Nova components
const fs = require('fs');
const path = require('path');
module.exports = function NovaWatcher(context, component_path = null)
{
this.mix = context;
this.path = path.resolve(process.cwd(), (component_path || './nova-components'));
this.components = fs.readdirSync(this.path);
@OwenMelbz
OwenMelbz / pull-push.sh
Created August 1, 2018 13:22
Statamic sync
#!/bin/bash
# This folder page could change between environments - careful!
env=$1
if [[ $env == "prod" ]]; then
cd /home/forge/www.selesti.com
else
cd /home/forge/pink.selesti.com
fi
@OwenMelbz
OwenMelbz / aliases.sh
Created July 16, 2018 11:27
SSH Aliases
alias code='cd ~/Sites'
alias nah='git reset --hard;git clean -df;'
gogo() {
git add .
git commit -m "$(echo $@)"
git pull
git push
}