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
var crypto = require('crypto'); | |
console.log(crypto.getHashes()); |
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 [ ! -f ~/.rednotebook/recent.lock ]; then | |
echo 'Pulling from remote repo...' | |
cd ~/.rednotebook/data | |
git pull | |
touch ~/.rednotebook/recent.lock | |
else | |
echo 'Pushing to remote repo...' | |
cd ~/.rednotebook/data |
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 fib(x){ | |
if(x>=0){ | |
switch(x){ | |
case 0: | |
return 1; | |
break; | |
case 1: | |
return 1; | |
break; | |
default: |
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 ] | |
then | |
echo "Setting timer for $1 minutes"; | |
DELAY=$(echo "scale=4; $1*60+1" | bc) | |
DTS=$(date +%H:%M:%S) | |
(sleep $DELAY; notify-send "TeaHelper by Vodolaz095" "$DTS : Tea is ready!") & | |
else | |
echo 'Enter how many minutes to wait for tea to be ready' |
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
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
# * https://gist.github.com/vodolaz095/8373960 | |
user nginx; | |
worker_processes 4; | |
error_log /var/log/nginx/error.log; | |
#error_log /var/log/nginx/error.log notice; |
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
var fs = require('fs'), | |
crypto = require('crypto'), | |
mhash = require('mhash').hash, //$ npm install mhash | |
crc32 = require('buffer-crc32'), //$ npm install buffer-crc32 | |
async = require('async'); //$ npm install async | |
console.log('Reading file'); | |
var content = fs.readFileSync('./download.htm'); |
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
//works on nodejs of 0.10.22 | |
//the WORKING code from there http://developer.yahoo.com/boss/geo/docs/codeexamples.html#oauth_js | |
//i think YAHOO have to test code before posting | |
var OAuth = require('oauth'), // `$ npm install oauth` | |
qs = require('querystring'); | |
function yahooSearch(consumerKey, consumerSecret, query, count, callback){ |
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
User "pound" | |
Group "pound" | |
LogLevel 0 | |
LogFacility - | |
Alive 1 | |
TimeOut 10 | |
ListenHTTP | |
Address 0.0.0.0 | |
xHTTP 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
#.bashrc | |
# Command «unpack» | |
unpack () | |
{ | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.tar.xz) tar xvJf $1 ;; | |
*.bz2) bunzip2 $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
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.send('hello world, this is route 1'); | |
}); | |
app.get('/', function(req, res){ | |
res.send('hello world, this is route 2'); | |
}); |