Skip to content

Instantly share code, notes, and snippets.

View liamegan's full-sized avatar
💭
┬─┬ノ(ಠ_ಠノ)

Liam Egan liamegan

💭
┬─┬ノ(ಠ_ಠノ)
View GitHub Profile
@liamegan
liamegan / value-noise-with-lut.frag
Created November 10, 2022 15:30
GLSL value noise with
uniform sampler2D s_noise;
float pn( in vec3 p ) {
vec3 i = floor(p); p -= i; p *= p*(3. - 2.*p);
p.xy = texture(s_noise, (p.xy + i.xy + vec2(37, 17)*i.z + .5)/256., -100.).yx;
return mix(p.x, p.y, p.z);
}
float hash(float h) {
return pn(vec3(h, -h, h + 134.23453));
@liamegan
liamegan / sketch.js
Created June 7, 2022 01:20
For Christa
function setup() {
createCanvas(windowWidth, windowHeight);
randomSeed(fxrand() * 999999);
noiseSeed(fxrand() * 999999);
noStroke();
fill(0);
ellipse(11, 145, 35, 35);
@liamegan
liamegan / licenses.js
Created December 4, 2021 16:02
A quick and dirty node shell script to get all of the production licenses from a package.
#!/usr/bin/env node
const { exec } = require("child_process")
async function run() {
let deps
exec("npm list --prod --depth=0 --json", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`)
return
I am attesting that this GitHub handle liamegan is linked to the Tezos account tz1LrQZuDuGrtozMZxhwQAZjdqJjXHPxVja8 for tzprofiles
sig:edsigth6Seh8fb6YVWkU3gdLDxuo7ep1AB7xaHbeeBh1dbc7irxss2cBvCwTK2xT2ixW1ndNKRbeESakFizDgKFy9HPcWA4Bim9
```
find -D 'exec' LOCATION -name PATTERN -exec sed -i 's/A/B/g' '{}' +
```
So for example
```
find -D 'exec' ./deploy -name '*.html' -exec sed -i 's/https:\/\/www.pokemontcg.com\//http:\/\/pokemontcg.wethe.work\//g' '{}' +
```
@liamegan
liamegan / Basic facebook publish image code
Created February 6, 2019 01:17
This is the basic code needed to generate an image with canvas and post it to facebook
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '2280604068667472',
cookie : true,
xfbml : true,
/* screen.scss
* In this file you should write your main styles. (or centralize your imports)
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
// Make sure the charset is set appropriately
@charset "UTF-8";
@import "compass/reset";
@liamegan
liamegan / preflight-tools.js
Last active March 20, 2018 21:40
Tools to use to debug and capture issues during website preflight.
// To find all of the controllers on a page and output their values.
document.querySelectorAll('[data-controller]').forEach((node)=> { console.log(node.dataset['controller']) })
@liamegan
liamegan / find-all-iframes.js
Created August 17, 2017 15:33
Find all iframes and show their details. Intended for the console.
document.querySelectorAll('iframe').forEach((iframe)=> {
console.log(iframe.id, iframe.className, iframe.src)
});

Keybase proof

I hereby claim:

  • I am liamegan on github.
  • I am harlequin (https://keybase.io/harlequin) on keybase.
  • I have a public key ASBmVukIhIOZTTjrQW4L6SkP_1PKhv4G53DbwbZdqI71SAo

To claim this, I am signing this object: