Skip to content

Instantly share code, notes, and snippets.

View tuefekci's full-sized avatar

Giacomo Tüfekci tuefekci

View GitHub Profile
out = {}
--var = {}
delay = 1
-- =====================================================
-- Functions
-- =====================================================
function math.average(t)
local sum = 0
for _,v in pairs(t) do -- Get the sum of all numbers in t
@tuefekci
tuefekci / Download Your Generations - leonardo.ai.js
Last active May 1, 2023 03:58
Download Your Generations - leonardo.ai
// ==UserScript==
// @name Download Your Generations - leonardo.ai
// @namespace Violentmonkey Scripts
// @match https://app.leonardo.ai/personal-feed
// @grant none
// @version 1.0
// @author Giacomo Tüfekci (https://github.com/tuefekci)
// @description 5/1/2023, 5:04:44 AM Returns a list of the urls of all Generations. Quick and Dirty.
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@1
@tuefekci
tuefekci / php-server-with-wordpress.md
Created April 2, 2023 15:59 — forked from bainternet/php-server-with-wordpress.md
Using PHP's built in server for WordPress development.

Preface

So in the past, I've used MAMP/MAMP Pro apps and others alike. I've also, setup my own local MAMP stack with homebrew, that used dnsmasq to dynamically add vhosts anytime I added a new folder to the Sites folder which made it very convenient. But, then I started running into other environment issues with PHP versions on remote machines/servers not being updated or some other crazy thingamabob breaking. I researched and invested time in Vagrant, but that seem to break more often than my homebrew setup. So I researched again investing time into Docker via Docker for Mac (which is BAMF), which I'm sold on and use daily, but it still seems a little bleeding edge and not so simple to wrap your head around the concept. Not to mention I don't have a real use case to play with and take advantage of all the features that come packed with Docker.

This is the beginning of trying to find something more simple, and slightly quicker to setup.

@tuefekci
tuefekci / private_fork.md
Created January 8, 2023 19:33 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@tuefekci
tuefekci / windows-cmd-faq.md
Created January 7, 2023 12:48 — forked from jkonrath/windows-cmd-faq.md
Windows CMD batch file frequent issues/tips

Writing Windows CMD Batch File Stuff

I hope I never have to write another Windows .BAT file again in my life, but if I don't jot this stuff down, I will forget it, and then I will.

Subroutines

  1. Use :somelabel to define a block of code.
  2. Use call :somelabel to jump to a defined label, run that block of code to the end, then return.
  3. Use goto :label to jump to that label.
  4. Put :eof at the end of your file.
@tuefekci
tuefekci / gist:baadb5acd4dbb372b1575962712591e9
Last active October 15, 2022 01:30
Factorio MoonLogic AAI Attack Squad
out = {}
--var = {}
delay = 1
-- =====================================================
-- Functions
-- =====================================================
function math.average(t)
local sum = 0
for _,v in pairs(t) do -- Get the sum of all numbers in t
@tuefekci
tuefekci / gist:66c185e4a905bb6440ed727d21d7e794
Created October 14, 2022 17:06
Factorio MoonLogic AAI Zoner
out = {}
local ressource = 0
if red['wood'] > 0 then
out['zone-x-green'] = 1
ressource = 1
end
if red['coal'] > 0 then
out['zone-x-black'] = 1
out = {}
if green['signal-green'] == 1 then
out['signal-x-tile'] = green['signal-x-tile']
out['signal-y-tile'] = green['signal-y-tile']
else
out['signal-x-tile'] = red['signal-x-tile']
out['signal-y-tile'] = red['signal-y-tile']
end
@tuefekci
tuefekci / gist:59f71d78e0a2e514e83d6681f8b7bc0a
Created October 14, 2022 17:05
Factorio MoonLogic if red['signal-enemy-unit-spawner'] > 0 or red['signal-enemy-turret'] > 0 or red['signal-enemy-unit'] > 0 then
out = {}
local ressource = 0
if red['signal-enemy-unit-spawner'] > 0 or red['signal-enemy-turret'] > 0 or red['signal-enemy-unit'] > 0 then
ressource = 1
else
out['signal-x-tile'] = red['signal-x-tile']
out['signal-y-tile'] = red['signal-y-tile']
end
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
import fs from 'fs';
const { Innertube, UniversalCache } = require('youtubei.js');
(async () => {
const youtube = await Innertube.create({