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
#include <RF22ReliableDatagram.h> | |
#include <Adafruit_GFX.h> | |
#include "Adafruit_ILI9340.h" // Hardware-specific library | |
#include <RF22.h> | |
#include <SPI.h> | |
#define CLIENT_ADDRESS 1 | |
#define SERVER_ADDRESS 2 | |
RF22ReliableDatagram rf22(SERVER_ADDRESS); |
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
#include <RF22ReliableDatagram.h> | |
#include <RF22.h> | |
#include <SPI.h> | |
#define CLIENT_ADDRESS 1 | |
#define SERVER_ADDRESS 2 | |
RF22ReliableDatagram rf22(CLIENT_ADDRESS); | |
void setup() { | |
Serial.begin(9600); |
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
#define RF22_MAX_MESSAGE_LEN 255 //<<<<<<<<<<<<<<<<<<<<<<< | |
#include <Adafruit_GFX.h> // Core graphics library | |
#include "Adafruit_ILI9340.h" // Hardware-specific library | |
#include <SPI.h> | |
#include <SD.h> | |
#include <RF22.h> // http://www.airspayce.com/mikem/arduino/RF22/index.html | |
RF22 rf22(10); // СS, INT .. по умолчанию 10, (D2) |
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
// Calculate and set ranges: today, yesterday, this week, past week, this month, past month, this year | |
switch(newValue) { | |
case 'today': | |
initial_date.setValue(new Date()); | |
end_date.setValue(new Date()); | |
break; | |
case 'yesterday': | |
var d = new Date(); | |
d.setDate(d.getDate() - 1); | |
initial_date.setValue(d); |
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
/** | |
* jQuery moneyMask plugin | |
* This plugin depends on https://github.com/acdvorak/jquery.caret | |
*/ | |
$.fn.moneyMask = function (options) { | |
/** | |
* @class MoneyMask | |
* @author Andrew Silin | |
*/ | |
function MoneyMask($input, options) { |
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
/** | |
* Include this code right after bxSlider. | |
* Use "mouseDrag" options upon bxSlider initialization to enable mouse drag: | |
* $('#slider').bxSlider({ | |
* mouseDrag: true | |
* }); | |
*/ | |
(function ($) { | |
var bxSlider = jQuery.fn.bxSlider; |
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
#!/bin/bash | |
case $1 in | |
"test") | |
sshpass -p 11111 ssh -o StrictHostKeyChecking=no [email protected] -p 25225 -t '(cd /var/www/vhosts/test/public_html/ ; /bin/bash )' | |
;; | |
*) | |
echo "server not found" | |
exit |
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
#!/bin/bash | |
set -e | |
NO_ARGS=0 | |
E_OPTERROR=85 | |
SERVER_ROOT_DOCUMENT_PATH=/home/andrew/Hosts | |
DOMAIN="" # ".lh" | |
OWNER='andrew:andrew' |
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
$.validator.setDefaults({ | |
onkeyup: false, | |
errorElement: 'div', | |
errorPlacement: function(error, element) { | |
error | |
.addClass('message') | |
.insertAfter(element); | |
}, | |
highlight: function(element, errorClass, validClass) { | |
$(element).parents('.field').addClass(errorClass); |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |