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
const http = require("http") | |
const url = require("url") | |
const path = require("path") | |
const fs = require("fs") | |
const port = process.argv[2] || 8888 | |
http.createServer(function(request, response) { | |
const uri = url.parse(request.url).pathname | |
let filename = path.join(process.cwd(), 'static', uri) | |
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
.model small | |
.stack 100h | |
.data | |
.code | |
start: | |
mov ax, @data | |
mov ds, ax |
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
mkdir "src/components/$1" | |
echo "import React from 'react' | |
import './$1.css' | |
export default class $1 extends React.Component { | |
render() { | |
return ( | |
<div className=\"$1\"> |
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
const http = require('http') | |
const url = require('url') | |
const path = require('path') | |
const fs = require('fs') | |
if(!process.argv[2]) { | |
throw new Error('please specify port as argumnet') | |
} | |
const port = parseInt(process.argv[2], 10) |
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
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ | |
абвгдеёжзийклмнопрстуфхцчшщъыьэюя | |
ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
abcdefghijklmnopqrstuvwxyz | |
0123456789 | |
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ |
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
const http = require('http') | |
const url = require('url') | |
const path = require('path') | |
const fs = require('fs') | |
const port = process.argv[2] || 8888 | |
http.createServer(function (request, response) { | |
if(request.method === 'GET') { | |
handleGet(request, response) |
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
setState({ | |
...state, | |
array: [ | |
...state.array.slice(0, i), | |
newArrayI, | |
...state.array.slice(i + 1), | |
] | |
}) |
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
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_' | |
export default function randomBase64(length) { | |
let str = '' | |
for(let i = 0; i < length; i += 1) { | |
str += alphabet[ | |
Math.floor( | |
Math.random() * alphabet.length | |
) |
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 <SoftwareSerial.h> | |
#include <SimpleTimer.h> | |
#define LED 13 | |
#define BT_POWER 12 | |
#define BT_RX 11 | |
#define BT_TX 10 | |
SoftwareSerial bluetoothPort(BT_TX, BT_RX); | |
SimpleTimer timer; |
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
const fs = require('fs') | |
const cp = require('child_process') | |
const vamuved = require('vamuved') | |
function exec (command) { | |
return new Promise((resolve, reject) => { | |
cp.exec(command, (error, stdout, stderr) => { | |
if (error) { | |
reject(error.message) |