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
<?php | |
/** | |
* Formats a JSON string for pretty printing | |
* | |
* @param string $json The JSON to make pretty | |
* @param bool $html Insert nonbreaking spaces and <br />s for tabs and linebreaks | |
* @return string The prettified output | |
* @author Jay Roberts | |
*/ |
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
// credit goes to the author of this code https://gist.github.com/sukima/5613286 | |
// How to use it | |
// Inject the service in the controller and then use it as follow: | |
// define a encription key; | |
// var encryptionKey = "147"; | |
// then you can decode and ancode with decode and encode methods | |
// var encodedString = xorcipher.encode(encryptionKey,"this is a string to encode") | |
// var decodedSting = xorcipher.decode(encryptionKey,encodedString) |
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
// include gulp | |
var gulp = require('gulp'); | |
// include plug-ins | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var minifyCSS = require('gulp-minify-css'); | |
var argv = require('yargs').argv; | |
var gulpif = require('gulp-if'); | |
var logwarn = require('gulp-logwarn'); |
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 re | |
def is_email_valid(email): | |
email_regex = ('^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@(' | |
'[a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|c' | |
'oop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mo' | |
'bi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{' | |
'1,3}))(:[0-9]{1,5})?$') |
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
Show hidden characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=759670 | |
// for the documentation about the jsconfig.json format | |
"compilerOptions": { | |
"target": "ES2015" | |
}, | |
"exclude": [ | |
"node_modules", | |
"bower_components", | |
"jspm_packages", |
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
(mbed) ❯ gulp --target=NRF52_DK | |
[21:55:54] Using gulpfile ~/dev/mbed-js-example/Gulpfile.js | |
[21:55:54] Starting 'make-build-dir'... | |
[21:55:54] Starting 'bundle'... | |
[21:55:54] Starting 'ignorefile'... | |
[21:55:54] Finished 'make-build-dir' after 46 ms | |
[21:55:54] Starting 'makefile'... | |
$ mkdir -p ./build/source | |
[21:55:54] Finished 'ignorefile' after 33 ms | |
[21:55:54] Finished 'makefile' after 14 ms |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
... | |
{ | |
test: /\.tsx?/i, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: [ | |
'es2015', |
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
//... | |
new workboxPlugin({ | |
globDirectory: DIST_DIR, | |
globPatterns: ['**/*.{html,js,css}'], | |
swDest: path.join(DIST_DIR, 'sw.js'), | |
}) | |
//... |
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
#include "msp430.h" | |
/* | |
* Piedinatura | |
* 1.6 -> uscita PWM PP1 | |
* 2.1 -> uscita PWM PP2 | |
* 2.2 -> uscita PWM continua | |
* 1.0 -> uscita led lampeggiante in sync con 1.6 | |
*/ |
OlderNewer