Skip to content

Instantly share code, notes, and snippets.

@krusynth
krusynth / gmaps_api_hax.html
Created July 3, 2012 15:49
Google Maps API Markers adding custom data to clicks, also Marker Clustering for large numbers of marker pins
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
@krusynth
krusynth / scrape.js
Created November 28, 2022 22:02
Mastodon scraper to get all of the folks followed by folks that you follow (your second-degree followers). Download your following_accounts.csv and put it in the same folder as this script. DO NOT RUN THIS if you follow lots (1000+) folks!!! That would be rude.
const fs = require('fs');
const readline = require('readline');
const https = require('https');
const reqOptions = {
timeout: 1000,
};
function get(url) {
// console.log(url);
@krusynth
krusynth / nested_terms.php
Last active November 15, 2021 03:13
Quick and easy way to translate flat arrays into nested arrays in PHP.
<?php
/**
* Wrapper to get terms in a nested fashion.
* This gets a little complicated. Basically, we're creating a placeholder in
* $children to hold the child terms of each parent term. Then we create a
* reference to that element in the parent term. So nesting happens via magic.
*/
public function get_terms_nested($args)
{
$temp_terms = $this->get_terms($args);
@krusynth
krusynth / github-team.py
Last active August 7, 2021 03:54
Python script to add all GitHub repositories to an organization team - permission is set to push. You'll need a settings.py file with your organization name and API key. Based off of my GitHub stats script (requirements.txt here): https://github.com/krues8dr/project-migration
#!/usr/bin/python
# Exports a CSV of repo names, readme files, and the license of the project.
from __future__ import print_function
import requests
import json
import settings
from urlparse import urlparse, parse_qs
import sys
@krusynth
krusynth / books.md
Last active June 15, 2021 16:56
A list of useful books to improve your skills

Recommended Books

A list of useful books to improve your skills

Recommendations from others are noted in (parentheses). The rest are my personal recommendations.

Programming

Building your core

  • The Pragmatic Programmer - Hunt & Thomas
@krusynth
krusynth / Kru_MultitileEvents.js
Created May 2, 2017 01:49
A plugin for RPG Maker MV to allow multitile events, instead of the 1x1 tile events that are the default.
//=============================================================================
// Multitle Events
// Version: 1.0.0
//=============================================================================
var Imported = Imported || {};
Imported.Kru_MultitileEvents = "1.0.0";
//=============================================================================
/*:
* @plugindesc 1.0.0 Allows for events that are bigger than 1 tile.
*
@krusynth
krusynth / font_awesome.rb
Last active February 27, 2021 14:12 — forked from 23maverick23/font_awesome.rb
Jekyll: Font Awesome icons Liquid tag
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Ryan Morrissey
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@krusynth
krusynth / google-fonts.md
Created November 18, 2014 16:39
Actually Pretty Good Google Fonts
@krusynth
krusynth / gist:2782431
Created May 24, 2012 16:04
S3 Uploader for Django
# ########################################################
# s3filefield.py
# Extended FileField and ImageField for use with Django and Boto.
#
# Required settings:
# AWS_BUCKET_NAME - String, represents the default bucket name to use if one isn't provided
# AWS_ACCESS_KEY - String
# AWS_SECRET_KEY - String
#
# From here: http://djangosnippets.org/snippets/1976/
@krusynth
krusynth / PromiseMap.js
Created November 1, 2019 21:16
A wrapper for Promise.all that maps the return data into an object/hash.
'use strict';
/* Promises.all but uses an Object instead of an array.
*
* Usage:
*
* PromiseMap({
* 'a': new Promise((resolve, reject) => resolve(1)),
* 'b': new Promise((resolve, reject) => resolve(2))
* }).then(result => console.log('done', result));