Skip to content

Instantly share code, notes, and snippets.

View sjcobb's full-sized avatar

Steven Cobb sjcobb

View GitHub Profile
@sjcobb
sjcobb / README.md
Created September 27, 2021 02:35 — forked from obahareth/README.md
GitHub GraphQL API Starred Repositories With Pagination

GitHub GraphQL API Starred Repositories Examples With Pagination

You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.

The first example gets your first 3 starred repos, the cursor values can be used for pagination.

Here's an example response from the first query:

{
@sjcobb
sjcobb / Install PyQt5 on Ubuntu with python3 .md
Created August 23, 2020 23:19 — forked from r00tdaemon/Install PyQt5 on Ubuntu with python3 .md
Install PyQt5 on Ubuntu with python3. Steps to set up PyQt5 (ubuntu). With python code generation

Installation

pip3 install --user pyqt5  
sudo apt-get install python3-pyqt5  
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools

Configuring to run from terminal

DaVinci Resolve Scripting Documentation

Updated as of 08 March 2019


In this package, you will find a brief introduction to the Scripting API for DaVinci Resolve Studio. Apart from this README.txt file, this package contains folders containing the basic import modules for scripting access (DaVinciResolve.py) and some representative examples.

Overview

As with Blackmagic Design Fusion scripts, user scripts written in Lua and Python programming languages are supported. By default, scripts can be invoked from the Console window in the Fusion page, or via command line. This permission can be changed in Resolve Preferences, to be only from Console, or to be invoked from the local network. Please be aware of the security implications when allowing scripting access from outside of the Resolve application.

@sjcobb
sjcobb / index.js Capture DOM element screenshot using Chrome headless
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@sjcobb
sjcobb / echarts-svg.js
Created February 7, 2020 15:02 — forked from pissang/echarts-svg.js
Server side SVG rendering of ECharts
const echarts = require("echarts");
const Canvas = require('canvas');
const {JSDOM} = require('jsdom');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return new Canvas(100, 100);
});
const {window} = new JSDOM();
global.window = window;
@sjcobb
sjcobb / arrayToCSV.js
Created December 6, 2019 20:57 — forked from yangshun/arrayToCSV.js
Converts a 2D array into a CSV file
function arrayToCSV (twoDiArray) {
// Modified from: http://stackoverflow.com/questions/17836273/
// export-javascript-data-to-csv-file-without-server-interaction
var csvRows = [];
for (var i = 0; i < twoDiArray.length; ++i) {
for (var j = 0; j < twoDiArray[i].length; ++j) {
twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas
}
csvRows.push(twoDiArray[i].join(','));
}
@sjcobb
sjcobb / akai_apc_mini_leds_webmidi.js
Created August 24, 2019 23:41 — forked from xangadix/akai_apc_mini_leds_webmidi.js
Controlling Leds on an AKAI APC mini through WebMidi
// Check this image, with all the buttons etc.
// https://d2r1vs3d9006ap.cloudfront.net/s3_images/1143703/apc_mini_midi.jpg
// these are the available colors
var OFF = 0;
var GREEN = 1;
var GREEN_BLINK = 2;
var RED = 3;
var RED_BLINK = 4;
var YELLOW = 5;
import pygame.midi
import homeassistant.remote as remote
import random
pygame.init()
pygame.fastevent.init()
pygame.midi.init()
input_id = pygame.midi.get_default_input_id()
api = remote.API()#your data goes HERE
@sjcobb
sjcobb / ngrxintro.md
Created April 23, 2019 19:07 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@sjcobb
sjcobb / introrx.md
Created March 17, 2019 00:19 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing