Skip to content

Instantly share code, notes, and snippets.

View appwiz's full-sized avatar
👍
Making people happy

Rohan Deshpande appwiz

👍
Making people happy
View GitHub Profile
@appwiz
appwiz / transcript.md
Last active May 6, 2023 20:28
Use GitHub issues as the link repository

Find all links from existing HTML files

ls *.html | xargs grep "Please follow" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*'

How to create a GH issue

gh issue create -b "" --label "link" --assignee "@me" --title ""
@appwiz
appwiz / Free+English+textbooks.csv
Last active May 1, 2022 01:37
Download free textbooks offered by Springer Nature
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 22 columns, instead of 10. in line 2.
Book Title,Author,Edition,Product Type,Copyright Year,Copyright Holder,Print ISBN,Electronic ISBN,Language,Language Collection,eBook Package,English Package Name,German Package Name,Series Print ISSN,Series Electronic ISSN,Series Title,Volume Number,DOI URL,OpenURL,Subject Classification,Publisher,Imprint
Fundamentals of Power Electronics,"Robert W. Erickson, Dragan Maksimovic",2nd ed. 2001,Graduate/advanced undergraduate textbook,2001,Springer Science+Business Media New York ,978-0-7923-7270-7,978-0-306-48048-5,EN,English/International,11647,Engineering,,,,,,http://doi.org/10.1007/b100747,http://link.springer.com/openurl?genre=book&isbn=978-0-306-48048-5,"Engineering; Circuits and Systems; Energy, general; Electronics and Microelectronics, Instrumentation; Energy Systems",Springer US,Springer
Handbook of the Life Course,"Jeylan T. Mortimer, Michael J. Shanahan",2003,Graduate/advanced undergraduate textbook,2003,Springer Science+Business Media New York,978-0-306-47498-9,978-0-306-48247-2,EN,English/Internatio
@appwiz
appwiz / erase-from-netlify.sh
Last active August 5, 2019 11:14
Erases all registered sites from your Netlify profile
for i in `netlify sites:list | grep "\w*-\w*-\w* - \w*" | cut -f3 -d" "`; do echo $i; netlify sites:delete --force $i; done;
@appwiz
appwiz / move.sh
Last active January 19, 2019 06:22
Moving a repository from BitBucket to GitHub
# needs hub installed via brew install hub
# hub will prompt for github credentials once with optional mfa
# https://help.github.com/articles/importing-a-git-repository-using-the-command-line/
BITBUCKET_USERNAME=<>
GITHUB_USERNAME=<>
REPOSITORY_NAME=<>
git clone --bare git@bitbucket.org:$BITBUCKET_USERNAME/$REPOSITORY_NAME.git
cd $REPOSITORY_NAME
# Click the orange "Play" button and select the createColorCommand
# mutation to create an object in DynamoDB.
# If you see an error that starts with "Unable to assume role",
# wait a moment and try again.
mutation createColorCommand($createcolorcommandinput: CreateColorCommandInput!) {
createColorCommand(input: $createcolorcommandinput) {
id
timestamp
color
}
@appwiz
appwiz / index.js
Created October 15, 2018 04:55
Voice Commands - Alexa Skill
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk-core');
const Amplify = require('aws-amplify');
const { API, graphqlOperation } = Amplify;
API.configure({
'aws_appsync_region': 'us-west-2',
'aws_appsync_authenticationType': 'API_KEY',
@appwiz
appwiz / CreateColorCommand.vtl
Created October 15, 2018 04:02
Voice Commands - API - CreateColorCommand
{
"version": "2017-02-28",
"operation": "PutItem",
"key": {
"id": $util.dynamodb.toDynamoDBJson($util.autoId()),
"timestamp": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()),
},
"attributeValues": $util.dynamodb.toMapValuesJson($ctx.args.input),
"condition": {
"expression": "attribute_not_exists(#id) AND attribute_not_exists(#timestamp)",
@appwiz
appwiz / index.js
Last active October 15, 2018 05:15
Voice Commands - NodejsApp
const { default: Amplify, API, graphqlOperation } = require('aws-amplify');
Amplify.configure({
'aws_appsync_region': 'us-west-2',
'aws_appsync_authenticationType': 'API_KEY',
'aws_appsync_graphqlEndpoint': '...',
'aws_appsync_apiKey': '...'
});
// POLYFILLS
@appwiz
appwiz / App.js
Last active October 16, 2018 04:30
Voice Commands - React App
import React, { Component } from 'react';
import './App.css';
import Amplify, { graphqlOperation } from "aws-amplify";
import { Connect } from "aws-amplify-react";
// TODO configure to point to your API
Amplify.configure({
'aws_appsync_region': 'us-west-2',
'aws_appsync_authenticationType': 'API_KEY',
'aws_appsync_graphqlEndpoint': '...',
@appwiz
appwiz / App.js
Last active October 16, 2018 04:31
Voice Commands - ReactApp - Add Subscriptions
// Add the subscription query
const OnCreateColorCommandSubscription = `
subscription onCreateColorCommand {
onCreateColorCommand {
__typename
id
color
timestamp
}
}