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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau | |
Africa/Blantyre |
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
const url = require('url'); | |
const router = require('express').Router(); | |
const passport = require('passport'); | |
const jwt = require('jsonwebtoken'); | |
const User = require('../schemas/user'); | |
router.post('/register', (req, res) => { | |
if(!(req.body.email && req.body.password)) return res.status(200).send('no password or email provided'); | |
User.findByEmail(req.body.email, (err, user) => { | |
if(user.length > 0) return res.status(200).send('user with given email exists'); |
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` |
OlderNewer