This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Torch.Templates do | |
@moduledoc """ | |
Module allowing to automatically manage templates depending of the given mix task | |
""" | |
@template_path "priv/templates" | |
def inject_templates(mix_task, options) do | |
out_directory = Keyword.get(options, :out_directory, "#{@template_path}/#{mix_task}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect, useState} from 'react'; | |
const getWindowDimensions = () => { | |
const {innerWidth: width, innerHeight: height} = window; | |
return { | |
width, | |
height | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line import/no-mutable-exports,prefer-const | |
export let baseUrl = process.env.REACT_APP_API_DOMAIN; | |
export const constructUrl = (path, queryParams = null) => { | |
const _url = new URL(baseUrl); | |
_url.pathname = path; | |
if (queryParams) _url.search = new URLSearchParams(queryParams).toString(); | |
return _url.toString(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from 'react'; | |
export default () => { | |
const isMounted = useRef(null); | |
useEffect(() => { | |
isMounted.current = true; | |
return () => { isMounted.current = false; }; | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react'; | |
export default (key, initialValue) => { | |
const [storedValue, setStoredValue] = useState(() => { | |
try { | |
const item = window.localStorage.getItem(key); | |
return item ? JSON.parse(item) : initialValue; | |
} catch (error) { | |
console.log(error); | |
return initialValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from 'react'; | |
export function PromiseCanceledError() { | |
this.name = 'PromiseCanceledError'; | |
} | |
const makeCancelable = (promise, abortController) => { | |
let isCanceled = false; | |
const wrappedPromise = new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
createContext, | |
useEffect, | |
useState, | |
useContext, | |
useMemo, | |
useCallback | |
} from "react"; | |
import history from "browser-history"; | |
import pathToRegexp from "path-to-regexp"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends KinematicBody2D | |
const WALK_SPEED = 125 | |
const RUN_SPEED = 250 | |
const GRAVITY_FORCE = 10 | |
const JUMP_FORCE = 280 | |
const AIR_CONTROL = 200 | |
var velocity = Vector2.ZERO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git ls-files -i --exclude-from=.gitignore | xargs git rm --cached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## STOP all containers | |
echo "Stoping all running containers" | |
docker ps -q | xargs --no-run-if-empty docker stop 2> /dev/null | |
## RM all containers | |
echo "Removing all containers" | |
docker ps -q -a --no-trunc --filter "status=exited" | xargs --no-run-if-empty docker rm 2> /dev/null | |
## RM all volumes | |
echo "Removing all volumes" | |
docker volume ls -q -f "dangling=true" | xargs --no-run-if-empty docker volume rm 2> /dev/null | |
## RM all networks |
NewerOlder