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
$locationProvider.hashPrefix('!'); | |
$locationProvider.html5Mode(true); | |
$locationProvider.baseHref = '/'; |
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
UPDATE `wp_postmeta` | |
SET `meta_value` = replace(meta_value , 'http://boredomtherapy.com', 'https://local.bt.com') |
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 numpy as np | |
def is_int(s): | |
try: | |
int(s) | |
return True | |
except ValueError: | |
return 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
<!--JQUERY--> | |
<script | |
src="https://code.jquery.com/jquery-3.2.1.min.js" | |
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" | |
crossorigin="anonymous"></script> | |
<!--BOOTSTRAP--> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" | |
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" |
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
// change old_key_name with new_key_name | |
db.collection.find().forEach(function(document) { | |
var old_key_name = document.old_key_name; | |
db.collection.update( | |
{ _id: document._id }, | |
{ | |
$set: { | |
new_key_name: old_key_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
type a = 'aaa'; | |
const b = 'a' + 'a' + 'a'; | |
let c: a; | |
const IsA = (string: string): string is a => string === 'aaa'; | |
c = b; // gives an error | |
if (IsA(b)) { |
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
// any type of callable | |
type callable = (...args: any[]) => any; | |
// only acept values of object T | |
type ValueOf<T> = T[keyof T]; |
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
getAtts = (elem) => { | |
const attrs = {}; | |
Object.values(elem.attributes).forEach(attr => { | |
attrs[attr.name] = attr.value; | |
}); | |
return attrs | |
} | |
atts = getAtts($0); | |
d3Str = ''; | |
d3Str += `.append('${$0.tagName}')\n` |
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
# install: brew install bash-completion | |
# then in .bash_profile | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "Node: Nodemon", | |
"processId": "${command:PickProcess}", | |
"restart": true, | |
"protocol": "inspector", |
OlderNewer