This file contains hidden or 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
| for file in *.wav; do lame -V2 "$file" "${file%.wav}".mp3 -b 128; done |
This file contains hidden or 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
| #!/bin/sh | |
| # place this under /usr/local/bin/tmux-dev | |
| if [ -z "$1" ] | |
| then | |
| echo "No session name supplied" | |
| exit 1 | |
| fi | |
| tmux new-session -d -s $1 |
This file contains hidden or 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 from 'react'; | |
| import { styled } from '@material-ui/styles'; | |
| import AppBar from '@material-ui/core/AppBar'; | |
| type CustomProps = { show: boolean }; | |
| // Let's imagine MyComponent is a special type of button... | |
| type MyComponentProps = CustomProps & React.HTMLProps<HTMLButtonElement>; | |
| const MyComponent = ({show, ...rest}: MyComponentProps) => { |
This file contains hidden or 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
| const useWindowSize = () => { | |
| const [dimensions, setDimension] = useState({ | |
| width: window.innerWidth, | |
| height: window.innerHeight, | |
| }); | |
| useEffect(() => { | |
| const handler = () => { | |
| const {innerWidth, innerHeight} = window; | |
| setDimension({ width: innerWidth, height: innerHeight}) |
This file contains hidden or 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
| /** | |
| * useScrollListener hook | |
| * Usage: const { scrollY, scrollDirection } = useScrollListener(); | |
| */ | |
| import { useState, useRef, useEffect } from 'react'; | |
| export function useScroll() { | |
| const [scrollY, setScrollY] = useState(0); | |
| const [progress, setProgress] = useState(0); |
This file contains hidden or 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
| :set backupcopy=yes |
This file contains hidden or 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
| body { | |
| padding: 10px; | |
| background: url('https://i.ytimg.com/vi/09nTwccQTUA/maxresdefault.jpg'); | |
| background-size: cover; | |
| font-size: 25px; | |
| margin: 0 auto; | |
| width: 100px; | |
| background-position: center; | |
| } |
This file contains hidden or 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
| function getParamsObj(url) { | |
| return url | |
| .split('?')[1] | |
| .split('&') | |
| .map(function(el) { | |
| return el.split('='); | |
| }) | |
| .reduce(function(prevVal, currVal) { | |
| prevVal[currVal[0]] = currVal[1] | |
| .split(',') |
This file contains hidden or 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
| app.factory('BearerAuthInterceptor', function ($window, $q) { | |
| return { | |
| request: function(config) { | |
| config.headers = config.headers || {}; | |
| if ($window.localStorage.getItem('token')) { | |
| // may also use sessionStorage | |
| config.headers.Authorization = 'Bearer ' + $window.localStorage.getItem('token'); | |
| } | |
| return config || $q.when(config); | |
| }, |
This file contains hidden or 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
| description "task for nodeJS powered site" | |
| author "António Capelo - [email protected]" | |
| # used to be: start on startup | |
| # until we found some mounts weren't ready yet while booting: | |
| start on started mountall | |
| stop on shutdown | |
| # Automatically Respawn: | |
| respawn |
NewerOlder