Skip to content

Instantly share code, notes, and snippets.

View Acen's full-sized avatar
💸

Zac Acen

💸
  • Auckland, New Zealand
View GitHub Profile
@Acen
Acen / HeroSections.jsx
Created April 6, 2022 01:53
i cri err tim
import React, {useEffect, useRef, useState} from "react"
import {GatsbyImage, getImage} from "gatsby-plugin-image"
import {classNames} from "../../../../utils"
import Clamp from "react-multiline-clamp"
import parse from 'html-react-parser'
import {MinusSmIcon, PlusSmIcon} from "@heroicons/react/solid";
export const Section = ({data, darken, side}) => {
const image = getImage(data.image?.localFile) ?? null
const bgClass = darken ? `bg-white` : `bg-white`
query ($uri: String!) {
wpPage(uri: { eq: $uri }) {
title
content
uri
slug
isFrontPage
wpFields {
homepage {
fieldGroupName
@Acen
Acen / SearchForNotSomething.json
Created August 13, 2021 03:18
Kibana - Searching for wildcard values with the query DSL
{
"query": {
"bool": {
"must_not": {
"wildcard": {
"error.string": {
"value": "Some sort of value*"
}
}
}
@Acen
Acen / UnparsedURL.php
Last active December 7, 2020 02:17
Facebook PHP Manual Unshim
<?php
/**
* Sourced from https://gist.github.com/Ellrion/f51ba0d40ae1d62eeae44fd1adf7b704
*/
class UnparsedURL
{
private $parts;
public function __construct(array $parts){
$this->parts = $parts;
@Acen
Acen / gist:03d9b54b2d114a63fa603bb5a3182a24
Created August 30, 2020 23:25 — forked from sofar/gist:41d1e70893f16d457ff1
init.lua - dump lua global table with table element size estimate
minetest.register_chatcommand("dump", {
params = "",
description = "Dump all objects in the global table",
func = function()
print("_G has "..#_G.." elements")
for k,v in pairs(_G) do
if k~="_G" then
if type(v)=="string" or type(v)=="number" then
print("G["..k.."]="..v)
elseif type(v)=="table" then
@Acen
Acen / Contract Killer 3.md
Created February 22, 2019 02:28 — forked from tony-caffe/Contract Killer 3.md
The latest version of Bytes Unlimted ‘killer contract’ for web professionals

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Revised by Bytes Unlimited : June 14th 2017

@Acen
Acen / loopy.py
Last active August 1, 2018 21:35
Loopy
from os import getcwd
from sys import path
from typing import Union
from threading import Timer
################################
###### CHANGEABLE OPTIONS ######
################################
# None yet fam.
-- Acen's buff/attack macro.
--[[
Key Selection
VK Key list: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
]]--
-- Activation/Deactivation
Key_Activate = 0xC0 -- ` (~)
-- Skills
Key_Skill1 = 0x10 -- SHIFT
@Acen
Acen / example_ga.blade.php
Last active July 1, 2018 15:27
Example Google Analytics Dimensions
Sending this data on every page view:
<script type="text/javascript">
ga('set', 'company_id', '{{ $company['company_id'] }}');
ga('set', 'monthly_spend', '{{ $company['monthly_spend'] }}');
ga('set', 'plan_name', '{{ $company['plan_name'] }}');
ga('set', 'renewal_date', '{{ $company['renewal_date'] }}');
ga('send', 'pageview');
</script>
OnRegistration:
@Acen
Acen / migration1.php
Created January 25, 2018 21:07
Migration things
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTokensTable extends Migration
{
/**
* Run the migrations.