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
#!/bin/bash | |
if [ "$1" == "vasya" ]; then | |
echo "Privet $1" | |
elif [ "$1" == "jack" ]; then | |
echo "Hello $1" | |
else echo "Zdarova $1" | |
fi | |
x="" | |
while [ "$x" != "q" ] |
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
RUN echo $'# This is a default site configuration which will simply return 404, preventing\n\ | |
# chance access to any other virtualhost.\n\ | |
server {\n\ | |
listen 80 default_server;\n\ | |
listen [::]:80 default_server;\n\ | |
# Everything is a 404\n\ | |
location / {\n\ | |
return 404;\n\ | |
}\n\ | |
# You may need this to prevent return 404 recursion.\n\ |
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
ENTRYPOINT ["/bin/ash", "-c", "sleep infinity"] |
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
do { //just repetance until condition Not (!) will be true | |
//just object of class with field Nonce this is integer type can be 1..2 ..3 -1.. -3.. -5.. -1000 ... 100.. 999 and so on | |
block.Nonce++; //Mining by incremention | |
block.Hash = BlockChainLibrary.Crypto.Sha256.CalcHash(block.ToHashString()); | |
//method just return concatenated string Index+PreviousHash+Timestapm+Data+Nonce $"{Index}{PrevHash}{Timestamp}{Data}{Nonce}"; | |
} while (!BlockChainLibrary.Crypto.Sha256.IsValidHash(block.Hash)); | |
Blocks.Add(block); |
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
(?s)<script(\stype=("|')text\/javascript("|'))?(\ssrc=".*?")?>.*?</script> |
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
//just add convenient menu to G suit | |
function onOpen() { | |
var ui=DocumentApp.getUi(); | |
ui.createMenu('Макросы') | |
.addItem('SelectionToTable', 'myFunction') | |
.addItem('ImageFiller','imageFiller') | |
.addToUi(); | |
//здесь можно дополнить менюшку | |
}; | |
//main function |
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
Get-ChildItem -File -Recurse | |
| % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace("LoadedFromRam","")} |
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
<form ng-submit="myFunct(nick,value)"> //If one button it can process Enter shotcut key | |
<input id="nickinput" type="text" name="name" ng-model="nick" autofocus> | |
<input id="chatinput" type="text" name="name" ng-model="value"> | |
<button ng-click="myFunc(nick,value)">Send</button> | |
</form> | |
//Controller | |
.controller('BodyController', function BodyController($scope, MyData) { | |
$scope.MyData = MyData; | |
$scope.myFunc = function(nick, s) { |
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
//dependency: https://github.com/websockets/ws | |
//dependency installation: npm install --save ws | |
var WebSocketServer = require('ws').Server, | |
wss = new WebSocketServer({ | |
port: 8080 | |
}); | |
// Broadcast to all. | |
wss.broadcast = function broadcast(data) { | |
wss.clients.forEach(function each(client) { |
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
function Observable () { | |
var observers = []; | |
this.sendMassage = function ( msg ) { | |
for (var i=0, i<observers.length;i++) { | |
observer[i].notify( msg ); | |
} | |
} | |
this.addObserver = function ( observer) { | |
observers.push( observer ); | |
}; |
NewerOlder