Skip to content

Instantly share code, notes, and snippets.

View goblincore's full-sized avatar
🐌
turtle

Donny goblincore

🐌
turtle
View GitHub Profile
@goblincore
goblincore / gist:499b10270ba153e6d6ba634521ac02bc
Created September 2, 2022 05:59
wip txt2img_k.py for k-4d
import argparse, os, sys, glob
import torch
import random
import torch.nn as nn
import numpy as np
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
from itertools import islice
from einops import rearrange
@goblincore
goblincore / blob-util.min.js
Created February 24, 2022 00:17 — forked from nolanlawson/blob-util.min.js
Read img tag, store it as a blob, then read it as a blob
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.blobUtil=e():"undefined"!=typeof global?global.blobUtil=e():"undefined"!=typeof self&&(self.blobUtil=e())}(function(){return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t){"use strict";function n(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=-1;++o<t;)r[o]=e.charCodeAt(o);return n}function r(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=-1;++o<r;)t+=String.fromCharCode(n[o]);return t}function o(e,t){return new L(function(n,r){var o=new Image;t&&(o.crossOrigin=t),o.onload=function(
@goblincore
goblincore / download-multiple-files.js
Created August 10, 2018 20:00 — forked from noelvo/download-multiple-files.js
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
@goblincore
goblincore / the-bind-problem.jsx
Created August 10, 2018 16:30 — forked from Restuta/the-bind-problem.jsx
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
@goblincore
goblincore / callingChildComponentInRender.js
Created August 7, 2018 15:11 — forked from vamsiampolu/callingChildComponentInRender.js
Example of calling extracted child component in render to avoid binding or declaring an arrow function
import React from 'react';
import UserListItem from './UserListItem';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
users: [
{ id: 1, name: 'Cory' },
{ id: 2, name: 'Meg' }
@goblincore
goblincore / cicd-config-clicker.md
Created August 6, 2018 19:58 — forked from cklanac/cicd-config-clicker.md
CICD: Travis CI and Heroku Instructions: 2 Versions - Point-n-Click and CLI Ninja

Setup Travis and Heroku CICD: Point-n-Click

Continuous Integration with Travis CI

Configure travis.yml

  • Run npm test to ensure tests are working correctly locally
  • Create .travis.yml file in repo
  • Add the following to configure for node
1. https://glitch.com/edit/#!/join/e8fa9708-f57e-41a2-a687-d42b656770e0
2. https://glitch.com/edit/#!/join/ab33c816-494f-4d8b-8351-f1e57e8637de
1. SURPRISE
https://glitch.com/edit/#!/join/098f4f68-16db-4417-97a3-9d01672cc340
2. RATE CALCULATOR
https://glitch.com/edit/#!/rune-teal
3. LIVE SEARCH
1. NAV BAR
https://glitch.com/edit/#!/join/1bc53a07-e60d-48f6-a933-e188fab64ad7
2. ADDRESS BOOK
https://glitch.com/edit/#!/join/64cd118e-a216-426d-bb50-eb0f6b90f689
//GET ALL
db.getCollectionNames()
//Limit and sort
Find the command that makes the first 10 restaurants appear when db.restaurants is alphabetically sorted by the name property.
db.restaurants.find().
sort({name:1}).