Skip to content

Instantly share code, notes, and snippets.

View OwenMelbz's full-sized avatar

Owen Melbourne OwenMelbz

View GitHub Profile
@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 / 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 / \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 / .babelrc
Last active May 22, 2020 08:49
Adds className support to React Native for Tailwind CSS Only
{
"plugins": ["./transformwind.js"]
}
@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) {
const defaults = require('./scripts/tailwind.defaults');
module.exports = defaults({
theme: {},
})
@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
*
@OwenMelbz
OwenMelbz / SuccessResource.php
Created April 9, 2025 10:13
return SuccessResource::make($data)
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class SuccessResource extends JsonResource
{
public function __construct(mixed $message, array $meta = [])
{