Visit my blog or connect with me on Twitter
git init
or
const exec = require('child_process').exec | |
const SPACE = ' ' | |
exec('ps aux | grep node', (err, stdout, stderr) => { | |
if (err !== null) { | |
return console.log(`exec error: ${err}`) | |
} | |
var data = stdout.toString().split('\n') | |
data.forEach((log) => { | |
if (log.endsWith('./bin/www')) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.0','packages':['corechart']}]}"></script> | |
<script> | |
var visual | |
google.setOnLoadCallback(function () { | |
visual = google.visualization | |
drawChart() | |
}) |
#! /bin/bash | |
# node update | |
echo 'update node.js...' | |
echo 'current node version:' | |
node -v | |
echo 'clean npm cache...' | |
sudo npm cache clean -f | |
echo 'update n...' | |
sudo npm install -g n |
Visit my blog or connect with me on Twitter
git init
or
function format (n) { | |
var str = n.toString() | |
for (var i = str.length - 3; i > 0; i -= 3) { | |
str = str.substring(0, i) + ',' + str.substring(i) | |
} | |
return str | |
} | |
var arr = [10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000] | |
arr.forEach(function (n) { |
In the default React Native app scaffolding you have to edit AppDelegate.m
to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.
NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.
NSURL *jsCodeLocation;
// Loading JavaScript code
#if DEBUG
// For Debug build load from development server. Start the server from the repository root:
# Brewの場合 | |
$ brew install tor | |
# Macportsの場合 | |
$ sudo port install tor |
GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
~=
&&
# Connect with Google Drive | |
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools | |
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null | |
!apt-get update -qq 2>&1 > /dev/null | |
!apt-get -y install -qq google-drive-ocamlfuse fuse | |
from google.colab import drive | |
drive.mount('/content/drive') |