Skip to content

Instantly share code, notes, and snippets.

View shellscape's full-sized avatar
🌴

Andrew Powell shellscape

🌴
View GitHub Profile
@moltar
moltar / gist:17ef5ac9da5b9bace73da725cd979292
Created June 3, 2022 08:55 — forked from archisgore/gist:d1dda9965db63342546501689fa3f309
Convert json-schema into AWS Glue struct schema (for automating JSON parsing in Glue using AWS CDK)
import request from 'sync-request';
import * as glue from '@aws-cdk/aws-glue';
export function polytectJsonSchemaToGlue(): glue.Type {
console.log("Getting Polytect reference schema...")
const res = request('GET', 'https://raw.githubusercontent.com/polyverse/polytect/master/reference/schema.json');
const body = res.getBody();
const schema = JSON.parse(body.toString());
return recursiveGlueColumns(schema, schema.definitions);
}
@narze
narze / settings.json
Created March 12, 2022 08:51
VSCode Customize UI settings
{
"customizeUI.activityBar": "top",
"customizeUI.activityBarHideSettings": true,
"customizeUI.font.monospace": "FantasqueSansMono Nerd Font",
"customizeUI.font.regular": "FantasqueSansMono Nerd Font",
"customizeUI.fontSizeMap": {
"12px": "11px",
"13px": "11px",
// "monospace": "11px", // Used for monospace fonts in user interface
"menu": "13px", // Used for menu items (windows only)
@artemlatark
artemlatark / index.js
Last active June 24, 2023 10:39
QR with rounded corners and logo
import QRCode from 'qrcode';
import { qrRender } from './qrRender';
function QR() {
const qrData = '12312312312';
const options = {
color: 'colored',
logo: 'fillstuff',
};
const qrSvg = qrRender(QRCode.create(qrData, { errorCorrectionLevel: 'Q' }), options);
@travishorn
travishorn / download-classdojo-media.md
Last active February 4, 2024 08:09
Saving the images and videos from your ClassDojo storyline

Archived

Please see Patrick330's fork of this script.

ClassDojo changes their site regularly, so a script like this needs regular maintenance. I have decided to archive this project and stop providing updates. Patrick330's fork linked above may be a good alternative.

Original Purpose

ClassDojo is a classroom communication app used to share reports between parents and teachers. Teachers track student behavior and upload photos or videos. The gamification style system teaches developmental skills through real-time feedback.

@elijahmanor
elijahmanor / package.json
Created January 10, 2018 14:46
npm script with color!
{
"name": "colors",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"color1": "echo '\\033[31mHello\\033[0m World'",
"color2": "echo \"\\033[31mHello\\033[0m World\""
},
"keywords": [],
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@fson
fson / example.js
Created March 17, 2016 15:10
Recursive GraphQL demo
import { inspect } from 'util';
import {
graphql,
GraphQLEnumType,
GraphQLID,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLList,
GraphQLNonNull,
GraphQLSchema,
@Zodiase
Zodiase / es6-abstract-class-example.js
Last active July 18, 2022 11:03
ES6 Abstract Class Example
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
@isaacs
isaacs / npmswitch-example.log
Last active December 18, 2015 09:39
This is how I change people's packages over to a different username in npm. It requires admin powers, of course, unless you're doing it with your own username.
$ curl http://registry.npmjs.org/-/by-user/testuser
{"testuser":["npm-test-blerg","npm-test-publish"]}
$ curl http://registry.npmjs.org/-/by-user/testuser2
{}
$ npmswitch testuser testuser2
+ npm cache clean npm-test-blerg
+ npm owner add testuser2 npm-test-blerg
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:testuser2
@robinsloan
robinsloan / langoliers.rb
Last active April 7, 2024 13:22
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"