Skip to content

Instantly share code, notes, and snippets.

View EntranceJew's full-sized avatar

EntranceJew EntranceJew

  • ejew.in, llc
  • Saint Petersburg, Florida
View GitHub Profile
@EntranceJew
EntranceJew / cssify.lua
Created August 10, 2015 21:43
In the event the LOVE api uses 0-1 instead of 0-255, break these functions out and cry deeply.
function cssify(...)
local args={...}
for k,v in pairs(args) do
args[k] = v / 255
end
return args
end
function uncssify(...)
local args={...}
@EntranceJew
EntranceJew / Player.lua
Last active December 9, 2019 11:24
Generating control handlers from a configuration table.using the tactile library in love2d. Whether or not you use the component-system separation is up to you!
-- inside Player:initialize()
local Player = class("Player")
Player:initialize()
--snip
self.keybinds = {
moveHorizontal = {
majorType = "Axis",
config = {
{
--[[
MeshGraph, a library to draw meshes as graphs.
@TODOS: a whole bunch of stuff
* canvas optimization?
* can't relocate, changes must propigate through the entire list of points
]]
local LineGraph = class("LineGraph")
<?php
/*
* A utility file to update a minecraft server that gets its resources from a solder link.
* Requires solder to respect the /:slug/:build:/server api request.
* Can work without it, with some modifications.
*/
//$mcversion = "1.7.10";
//$forgeversion = "1.7.10-10.13.4.1492-1.7.10";
@EntranceJew
EntranceJew / _readme.md
Created October 19, 2015 15:30 — forked from josefnpat/.gitignore
MLGUI - Minimal Love Graphical User Interface

MLGUI

Minimal Love Graphical User Interface

selling points:

  • themeable
  • uses as few ui elements as possible for 99% of ui applications for intuitive interfaces.
  • widgets are added to a container/panel that "automagically" organizes elements
  • container/panels automatically resize for flow
@EntranceJew
EntranceJew / irony.css
Created April 4, 2016 14:48
to prevent your code from going straight to production, include this
.ironic {
font-family: "Comic Sans MS", "Comic Sans", cursive;
color: rebeccapurple;
font-size: 26pt;
text-shadow: black 0px 3px 18px;
text-align: center;
display: block;
width: 100%;
@EntranceJew
EntranceJew / getWorkshopIdsOnPage.js
Created August 2, 2016 23:59
Find all the workshop IDs real quick.
function getWorkshopIdsOnPage(){
var _workshop_ids="";
document.querySelectorAll('.collectionItemDetails a[href*="filedetails"').forEach(
function(cv, i, arr){
var url = cv.attributes.getNamedItem('href').value;
_workshop_ids += url.split('=')[1] + "\n";
}
);
console.log(_workshop_ids);
}
@EntranceJew
EntranceJew / gen.lua
Last active August 18, 2016 19:24
gen_smooth_noise
local lerp = function(a, b, amount)
return a + (b - a) * (amount < 0 and 0 or (amount > 1 and 1 or amount))
end
function gen_smooth_noise(width, height, baseNoise, octave)
local bit = require("bit")
local idata = love.image.newImageData( width, height )
-- Sample period = 2 ^ octave;
local samplePeriod = bit.lshift(1, octave)
@EntranceJew
EntranceJew / show_all_scripts.js
Created August 24, 2016 16:21
show_all_scripts.js
(function(document){
var i, scripts = document.getElementsByTagName("script"),
attributes = new Map([
['fontFamily', 'Menlo,Monaco,Consolas,"Courier New",monospace'],
['overflow', 'auto'],
['display', 'block'],
['backgroundColor', '#f5f5f5'],
['border', '1px solid #cccccc'],
['borderRadius', '4px'],
['whiteSpace', 'pre']
@EntranceJew
EntranceJew / Get-TweetVid.ps1
Created May 17, 2017 20:33
take a twitter m3u8 link and download it properly
# take a twitter m3u8 link and download it properly
function Get-TweetVid {
param( [string]$Uri, [string]$OutDir )
$out_file = (Split-Path $Uri -Leaf).Replace(".m3u8", ".mp4")
$out_path = Join-Path $OutDir $out_file
if( -Not (Test-Path $out_path) ){
mkdir -Path $out_path
}
ffmpeg -i $Uri -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $out_path
}