This file contains hidden or 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
| # | |
| # mlib: common client js routines v0.5.0 | |
| # m@penzin.ru | |
| # | |
| # -- globals -- | |
| window.lib = x = {} | |
| # window._csrf used as token, replaced by _csrf cookie if empty |
This file contains hidden or 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
| // - http://habrahabr.ru/post/236251/ | |
| // set edge event on specific gpio_line | |
| int gpio_edge_set(int n, const char *edge_str) | |
| { | |
| char filename[PATH_MAX]; | |
| FILE *file; | |
| snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d/edge", n); |
This file contains hidden or 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
| // | |
| // arduino pro micro | |
| // | |
| #define POWER_GREEN 240 | |
| #define POWER_YELLOW 40 | |
| #define POWER_BLINK 20 | |
| #define POWER_OFF 3 |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """ | |
| mpws: main | |
| @author: maxp | |
| """ | |
| from datetime import datetime, timedelta | |
| import conf |
This file contains hidden or 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
| ### Raspberry Pi setup | |
| (29.04.2014) | |
| http://downloads.raspberrypi.org/raspbian_latest | |
| # 2014-01-07-wheezy-raspbian.zip | |
| dd if=2014-01-07-wheezy-raspbian.img od=/dev/mmcblk0 |
This file contains hidden or 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
| require('crypto').createHash('sha1').update("123").digest('hex') | |
This file contains hidden or 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
| ' Функции рабочей книги для преобразования | |
| ' геодезических координат из координатной системы Пулково 1942 | |
| ' в координатную систему WGS84 | |
| ' Все угловые значения передаются и возвращаются в градусах, | |
| ' высоты передаются и возвращаются в метрах | |
| ' Сделано на основании ГОСТ Р 51794-2001 Российской Федерации |
This file contains hidden or 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 Pi As Double = 3.14159265358979 ' Число Пи | |
| Const ro As Double = 206264.8062 ' Число угловых секунд в радиане | |
| ' Эллипсоид Красовского | |
| Const aP As Double = 6378245 ' Большая полуось | |
| Const alP As Double = 1 / 298.3 ' Сжатие | |
| Const e2P As Double = 2 * alP - alP ^ 2 ' Квадрат эксцентриситета | |
| ' Эллипсоид WGS84 (GRS80, эти два эллипсоида сходны по большинству параметров) | |
| Const aW As Double = 6378137 ' Большая полуось |
This file contains hidden or 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
| 'use strict'; | |
| // Add ECMA262-5 method binding if not supported natively | |
| // | |
| if (!('bind' in Function.prototype)) { | |
| Function.prototype.bind= function(owner) { | |
| var that= this; | |
| if (arguments.length<=1) { | |
| return function() { | |
| return that.apply(owner, arguments); |
This file contains hidden or 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 settings = JSON.parse( | |
| require('fs').readFileSync( | |
| require('path').resolve(__dirname, 'settings.json'), | |
| 'utf8' | |
| ) | |
| ); |