curl http://localhost:3000/messages
curl -d '{"login": "zbicin", "message": "test message"}' -H "Content-Type: application/json" -X POST http://localhost:3000/sendMessage
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const cors = require('cors'); | |
| const readline = require('readline'); | |
| const childProcess = require('child_process'); | |
| const https = require('https'); | |
| const app = express(); | |
| if (process.argv.includes('--prompt')) { |
Najprostszym i najpewniejszym sposobem na bezproblemową instalację Node.js jest użycie NVM (Node Version Manager), który pobierze za nas odpowiednią paczkę, zainstaluje ją i ustawi poprawnie wszystkie systemowe ścieżki.
https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-setup.zip
| #!/bin/bash | |
| # Source: https://danielgibbs.co.uk/2016/06/send-pushbullet-message-from-bash/ | |
| token="<paste token here>" | |
| title=${1:-Default title} | |
| body=${2:-Default body} | |
| curl --silent -u """$token"":" -d type="note" -d body="$body" -d title="$title" 'https://api.pushbullet.com/v2/pushes' |
(function(){const copyText=(text)=>{const textField=document.createElement('textarea');textField.innerText=text;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove()};const branchLinks=document.querySelectorAll('.ms-Link.vc-pullrequest-detail-branch-name, .vc-branches-container .vss-PickListDropdown--title-text');if(branchLinks.length<1){alert('Branch link not found')}else{const branchName=branchLinks[0].innerText.trim();copyText(branchName);const oldTitle=document.title;document.title=`📋 Copied: "${branchName}"`;setTimeout(()=>document.title=oldTitle,1000)}})()
| // ==UserScript== | |
| // @name copyJson | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Stringifies given argument and copies it to the clipboard. | |
| // @author @zbicin | |
| // @match *://localhost*/* | |
| // @grant none | |
| // ==/UserScript== |
| #!/bin/bash | |
| tap () | |
| { | |
| adb shell sendevent /dev/input/event1 3 57 9148 | |
| adb shell sendevent /dev/input/event1 3 53 $1 | |
| adb shell sendevent /dev/input/event1 3 54 $2 | |
| adb shell sendevent /dev/input/event1 3 58 54 | |
| adb shell sendevent /dev/input/event1 0 0 0 | |
| adb shell sendevent /dev/input/event1 3 57 -1 | |
| adb shell sendevent /dev/input/event1 0 0 0 |
| function damnHandler(e) { | |
| console.log('%c.', 'font-size: 1px; line-height: 140px; padding: 70px 125px; background: url("https://media.giphy.com/media/r1HGFou3mUwMw/giphy-downsized.gif");'); | |
| throw e; | |
| } |
| function parseUrlParameters() { | |
| var result = {}; | |
| var keyValueCombined = location.search.substr(1).split('&'); | |
| for(var i = 0; i<keyValueCombined.length; i++) { | |
| var splitted = keyValueCombined[i].split('='); | |
| var key = splitted[0]; | |
| var value = splitted.slice(1).join('='); | |
| result[key] = value; | |
| } | |
| /* | |
| * Directive focusing an element when given scope variable becomes boolean true. | |
| * If the variable becomes equal to boolean false the element is blurred. | |
| * Usage: <input type="text" focus-on="someScopeVariable === 1" /> | |
| */ | |
| angular.module('FocusOnDirective').directive('focusOn', ['$timeout', function ($timeout) { | |
| 'use strict'; | |
| return { | |
| restrict: 'A', |