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
# npm | |
npm ls -g --depth=0 --link=true | |
C:\Program Files\nodejs -> .\ | |
└── @xx/xx-design@0.0.14 -> .\..\..\..\..\repo\xxx-design | |
# yarn | |
On Windows you can find the linked packages at ls ~/AppData/Local/Yarn/Data/link/ |
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
export const addStyle = (src: string) => { | |
let styles = document.createElement('link'); | |
styles.rel = 'stylesheet'; | |
styles.type = 'text/css'; | |
styles.media = 'screen'; | |
styles.href = src; | |
document.getElementsByTagName('head')[0].appendChild(styles); | |
}; | |
export const addScript = async (src: string) => { |
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
const clearCookieAndStorage = () => { | |
// clear cookies | |
(function () { | |
setTimeout(() => { | |
var cookies = document.cookie.split("; "); | |
for (var c = 0; c < cookies.length; c++) { | |
var d = window.location.hostname.split("."); | |
while (d.length > 0) { | |
var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path='; |
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
<!DOCTYPE html> | |
<html> | |
<style type="text/css"> | |
.time {} | |
.percentage { | |
color: red; | |
font-size: 5em; | |
} | |
</style> |
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
{ | |
"python.pythonPath": "~/.virtualenvs/djangosite/bin/python", | |
"python.linting.pep8Enabled": true, | |
"python.linting.pep8Args": [ | |
"--ignore=E501" | |
], | |
"python.linting.pylintPath": "~/.virtualenvs/djangosite/bin/pylint", | |
"python.linting.pylintArgs": [ | |
"--load-plugins", | |
"pylint_django" |
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
const Adder = new function() { | |
this.sum = 0; | |
this.add = function(numbers) { | |
numbers.forEach(function(n) { | |
this.sum +=n; | |
}); | |
}; | |
} | |
Adder.add([1, 2, 3]); |
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
{ | |
"name": "Jest Tests", | |
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js", | |
"type": "node", | |
"request": "launch", | |
"args": [ | |
"-i" | |
], | |
} |
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
Jenkin + fastlane draft | |
brew services start jenkins-lts | |
brew services restart jenkins-lts | |
PATH=$PATH:/usr/local/bin/ | |
# ENV["FASTLANE_PASSWORD"] = "123123123" | |
cert |
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 COMMAND | |
//edit the last commit | |
git commit --amend -m "New commit message" | |
#Remove information on branches that were deleted on origin | |
git fetch --prune | |
# to create a new branch and switch to it in one step | |
$ git checkout -b <branch-name> |
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 UIKit | |
func isExactClass<T>(obj: Any, _ _: T.Type) -> Bool{ | |
return type(of: obj) == T.self | |
} | |
class Dog { | |
NewerOlder