Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# ======================
# Check Azure CLI is installed
# ======================
if ! [ -x "$(command -v az)" ]; then
echo 'Error: Azure cli is not installed.' >&2
exit 1
fi
import click
import re
def parse_processed_log(processed_log_file):
"""Parse the processed log file from
$ node --prof-process isolate.log > proc.log
Prints and returns the summary
:param processed_log_file: <str>
@jtara1
jtara1 / np.sh
Created September 17, 2018 22:41
#!/usr/bin/env bash
#############################################
# node profiler
# Runs the Node V8 Profiler
# and analyzes the output after the node app
# exits
# usage example:
# $ sh np.sh index.js --my-flag --my-arg 42 &
# $ pid=$!
# $ kill -s USR1 $pid
/* value_equals.js
The MIT License (MIT)
Copyright (c) 2013-2017, Reactive Sets
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
import { Component } from 'react';
import ReactDOM from 'react-dom';
class InventoryView extends Component {
getTableBodyAsReactElement() {
let inv = [{'upc': 123}, {'upc': 454}];
console.log('inv: ', inv);
return (!inv) ? null : (
<tbody>
@jtara1
jtara1 / alpha-numeric-list-troubles.js
Last active March 13, 2018 03:49
alpha-numeric-list generation yields empty Array within React Native app but works in chrome console
let alphabet = [...Array(26).keys()]
.map(x => x + 65)
.map(x => String.fromCharCode(x));
console.log(alphabet);
// [0, 1, ..., 9, A, B, C, ..., Z]
// let alphanumericCharacters = _.concat(_.range(10), alphabet);
let alphanumericCharacters = [...Array(10).keys()]
.concat(alphabet);
sudo su -
wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/11.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
apt update && apt-get install odoo -y
sudo apt install python3-pip -y
sudo pip3 install vobject qrcode
sudo apt install libldap2-dev libsasl2-dev
sudo pip3 install pyldap
sudo pip3 install xlwt
@jtara1
jtara1 / UpdateOSTime.cpp
Created December 23, 2017 05:57
Change system date programmatically (stackoverflow) https://stackoverflow.com/a/652391/3854436 solution doesn't work
// UpdateOSTime.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <iostream>
/* source from: https://stackoverflow.com/a/652391/3854436
* VS 2017 needed some project config changes: https://stackoverflow.com/a/20595744/3854436
*/
from heapq import *
class A:
def __init__(self, val):
self.val = val
def __lt__(self, cmp):
"""Overwrite this to do the opposite of what's
expected"""
<annotation>
<folder>wakfu2</folder>
<filename>iron ore4.jpg</filename>
<path>/home/j/_Github-Projects/raccoon-dataset/images/iron ore4.jpg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>2552</width>
<height>1378</height>