Install the line_profiler
module:
[driti@ubuntu ]$ pip install line_profiler
Add the @profile
decorator and run:
[driti@ubuntu ]$ kernprof.py -l -v example.py
# coding: utf-8 | |
# Can ruby have method names have newlines/be crazy? | |
class BadKitty | |
FACE = " | |
|\\_/| | |
/ @ @ \\ | |
( > º < ) | |
`>>x<<´ |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
/* | |
License: MIT | |
Easily formattable date difference. | |
DateFromNow(someDate).simple(); //ex. returns '3 days ago'; | |
DateFromNow(someDate).parts(); //ex. returns {years: null, months: null, days: 3, hours: 8, minutes: 52, seconds: 43}; | |
*/ |
$('.outdated-diff-comment-container').addClass('open'); |
Install the line_profiler
module:
[driti@ubuntu ]$ pip install line_profiler
Add the @profile
decorator and run:
[driti@ubuntu ]$ kernprof.py -l -v example.py
curl -L https://github.com/coreos/etcd/releases/download/v2.1.0-rc.0/etcd-v2.1.0-rc.0-linux-amd64.tar.gz -o etcd-v2.1.0-rc.0-linux-amd64.tar.gz
tar xzvf etcd-v2.1.0-rc.0-linux-amd64.tar.gz
cd etcd-v2.1.0-rc.0-linux-amd64
./etcd
by default etcd listening on port 2379 for client communication and on port 2380 for server to server communication
Test
import time | |
import hashlib | |
import hmac | |
import urllib | |
def get_sso_url(email, name, base_url, key, redirect_url=None, phone=None, company=None): | |
"""This function returns the Freshdesk SSO URL. | |
For more info look at https://goo.gl/NISgpr | |
""" | |
utctime = int(time.time()) |
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
babelify = require('babelify'), | |
source = require('vinyl-source-stream'), | |
browserify = require('browserify'), | |
watchify = require('watchify'), | |
browserSync = require('browser-sync').create(); | |
var paths = { | |
HTML: 'src/index.html', |
import express from 'express'; | |
import { ApolloServer } from 'apollo-server-express'; | |
import { ApolloServerPlugin } from 'apollo-server-plugin-base'; | |
import * as Sentry from '@sentry/node'; | |
Sentry.init({ | |
environment: process.env.APP_ENV, | |
// see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482 | |
release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1', | |
dsn: process.env.SENTRY_DSN, |
import React, { Component } from 'react'; | |
export default function withPropsChecker(WrappedComponent) { | |
return class PropsChecker extends Component { | |
componentWillReceiveProps(nextProps) { | |
Object.keys(nextProps) | |
.filter(key => { | |
return nextProps[key] !== this.props[key]; | |
}) | |
.map(key => { |