Skip to content

Instantly share code, notes, and snippets.

@ro31337
ro31337 / morse.ino
Created May 6, 2017 20:10
Arduino morse SOS code
int ledPin = 11;
void setup() {
pinMode(ledPin, OUTPUT);
}
void dash() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
# Right way to install Chocolatey - always specify version to avoid breaking changes!
$ChocoInstallPath = "$env:SystemDrive\ProgramData\Chocolatey\bin"
$env:chocolateyVersion = '0.9.10.3' # <-- HERE
if (!(Test-Path $ChocoInstallPath)) {
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
}
# do NOT cut and paste, hidden surprise here!
$ChocoInstallPath = "$env:SystemDrive\ProgramData\Chocolatey\bin"
if (!(Test-Path $ChocoInstallPath)) {
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
}
$ gulp browserify
[06:48:59] Using gulpfile ~/work/boilerplate/gulpfile.js
[06:48:59] Starting 'browserify'...
[06:49:01] Finished 'browserify' after 1.59 s
$ ls -lh ./dist
total 1312
-rw-r--r-- 1 Roman home 654K Feb 23 09:49 bundle.js
// convert React components to be used in the browser
gulp.task('browserify', function() {
var babelifyConfig = babelify.configure({presets: ['es2015', 'react'], extensions: ['.jsx']});
return browserify({
entries: 'src/app.jsx', // the same as "--extension=.jsx src/**/*.jsx"
extensions: ['.jsx']
})
.transform(babelifyConfig) // the same as -t command line parameter
.bundle() // "readable stream with the javascript file contents"
var source = require('vinyl-source-stream');
// ...
.transform(babelifyConfig) // the same as -t command line parameter
.bundle() // "readable stream with the javascript file contents"
.pipe(source('bundle.js')) // "conventional text stream at the start of our gulp pipeline", wrapped with "pipe" method
.pipe(gulp.dest('dist')); // standard gulp way to redirect gulp pipe to directory
gulp.task('browserify', function() {
var babelifyConfig = babelify.configure({presets: ['es2015', 'react'], extensions: ['.jsx']});
return browserify({
entries: 'src/app.jsx', // the same as "--extension=.jsx src/**/*.jsx"
extensions: ['.jsx']
})
.transform(babelifyConfig) // the same as -t command line parameter
.bundle()
.pipe(process.stdout);
var browserify = require('browserify');
var b = browserify();
b.add('./browser/main.js');
b.bundle().pipe(process.stdout);
var babelifyConfig = babelify.configure({presets: ['es2015', 'react']});
return browserify({
entries: 'src/app.jsx',
extensions: ['.jsx']
})
.transform(babelifyConfig) // the same as -t command line parameter
var browserify = require('browserify');
var babelify = require('babelify');