$ docker
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
from django.test import TestCase | |
# Create your tests here. | |
from django.urls import reverse | |
from rest_framework.test import APITestCase, APIClient | |
from rest_framework.views import status | |
from .models import Songs | |
from .serializers import SongsSerializer | |
# tests for views |
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
handlePageChange = (name) => { | |
Object.keys(this.state).map( | |
i => i === name ? this.setState({[name]: true}) : this.setState({[i]: false})) | |
} | |
goBack = () => { | |
Object.keys(this.state).map( | |
i => this.setState({ [i]: true })) | |
} |
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
constructor(props) { | |
super(props); | |
this.state = { width: 0, height: 0 }; | |
this.updateWindowDimensions = this.updateWindowDimensions.bind(this); | |
} | |
componentDidMount() { | |
this.updateWindowDimensions(); | |
window.addEventListener('resize', this.updateWindowDimensions); | |
} |
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
["lap", "update", "reset", "toggle", "spacebarListener"].forEach(method => { | |
this[method] = this[method].bind(this); | |
}); |
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 localStorage = global.window.localStorage; | |
export function get(key) { | |
return localStorage.getItem(key); | |
} | |
export function set(key, value) { | |
if (value === null) { | |
localStorage.removeItem(key); | |
} else { |
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
How to remove node_modules | |
Create a .gitignore file in the git repository if it does not contain one | |
touch .gitignore 2. Open up the .gitignore and add the following line to the file | |
node_modules 3. Remove the node_modules folder from the git repository | |
git rm -r --cached node_modules 4. Commit the git repository without the node modules folder | |
git commit -m "Removed node_module folder" 5. Push the repository to github |
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 gmailAutoarchive() { | |
var threads = GmailApp.search("in:inbox label:auto-archive older_than:2d"); | |
Logger.log("found " + threads.length + " threads:"); | |
for(var i = 0; i < threads.length; i++) { | |
var thread = threads[i]; | |
Logger.log((i+1) + ". " + thread.getFirstMessageSubject()); | |
} | |
var batch_size = 100; |
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
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); |
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.use(express.json()); | |
app.use(express.urlencoded({ extended: true })); |