Skip to content

Instantly share code, notes, and snippets.

View gruckion's full-sized avatar
💊
Currently working hard in the next step up in my career.

Stephen Rayner gruckion

💊
Currently working hard in the next step up in my career.
View GitHub Profile
@DanielCender
DanielCender / fetchItemsNextToken.js
Created November 24, 2019 04:46
A recursive function calling AppSyncClient GraphQL requests for ReactNative apps
import { Logger } from 'aws-amplify';
const logger = new Logger('fetchItemsNextToken', 'VERBOSE');
/**
* @desc Recursively fetch all items in a list query using nextToken
* @param {Object} client An AppSyncClient instantiation
* @returns {Object} { items, key } Items are results,
* key is the name of the query called.
*/
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@victorbruce
victorbruce / Firebase.md
Last active March 12, 2024 12:07
My journey with Firebase so far. Cheatsheet to serve as a quick reference when developing firebase applications

Firebase

Set up firebase and Deploy

  • Head over to firebase. Sign in and create a project.

  • Copy your project settings under Firebase SDK snippet into your local project (ie your project's api key, auth domain, databaseURL, etc)

  • Create a file (firebase.js or config.js Any name that suits you is fine)

@mehulmpt
mehulmpt / profiles.json
Last active December 11, 2021 09:58
Sample profiles.json for new Windows Terminal
{
"defaultProfile": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"profiles": [
{
"guid": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
@FradSer
FradSer / iterm2_switch_automatic.md
Last active April 23, 2024 02:40
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@kerwynrg
kerwynrg / Root.jsx
Last active November 13, 2018 11:12
Workaround to work with create-react-app-typescript and react-hot-loader
import * as React from 'react';
import { hot } from 'react-hot-loader';
import { Provider } from 'react-redux';
import DevTools from '../Devtools';
import configureStore from '../../store/configureStore';
import App from '../App';
import ApplicationState from '../../store/store.types';
import { fetchAuth } from '../../store/common/Auth/Auth';
@nastanford
nastanford / counter_reactjs.html
Created September 2, 2017 14:57
Simple Example React Code used on jsComplete.com
class Button extends React.Component {
handleClick = () => {
this.props.onClickFunction(this.props.incrementValue);
};
render() {
return (
<button onClick={this.handleClick}>
+{this.props.incrementValue}
</button>
@laughinghan
laughinghan / MathSON.md
Last active December 7, 2023 21:52
MathSON - JSON for Math Formulae

MathSON

Status: Draft 1 In Progress. This document is undergoing its first revision. Initial implementation has begun alongside editing Draft 1. Your feedback is hoped and dreamed of.

Mathematical Structured Object Notation is a JSON-based representation for most of the common subset of what LaTeX and Presentation MathML can

@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 29, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@andrewmurray
andrewmurray / gist:b63b7592386cb67124d1
Last active February 14, 2024 12:17
Convert an Epplus ExcelPackage to a CSV file, returning the byte[] array of this new CSV file. Taking the code provided by "Brad" at http://codejournal.blogspot.co.uk/2012/03/using-epplus-library-to-convert-xlsx-to.html and creating an extension method from it which can be called on Epplus' ExcelPackage. Just call excelPackageObject.ConvertToCsv();
using OfficeOpenXml;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace WebUI.Infrastructure
{
public static class StringUtils
{
private static string DuplicateTicksForSql(this string s)