Skip to content

Instantly share code, notes, and snippets.

#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);
#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);
#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)
@connected
connected / date_ranges.js
Created May 30, 2018 13:52 — forked from jllodra/date_ranges.js
Calculate start/end dates for common ranges in Javascript.
// 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);
/**
* 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) {
@connected
connected / bxslider-drag.js
Last active October 12, 2022 23:37
bxSlider mouse drag extension
/**
* 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;
@connected
connected / connect.sh
Created January 6, 2015 09:22
SSH Connect
#!/bin/bash
case $1 in
"test")
sshpass -p 11111 ssh -o StrictHostKeyChecking=no test@test.lv -p 25225 -t '(cd /var/www/vhosts/test/public_html/ ; /bin/bash )'
;;
*)
echo "server not found"
exit
@connected
connected / makehost.sh
Created October 10, 2014 07:09
Create host
#!/bin/bash
set -e
NO_ARGS=0
E_OPTERROR=85
SERVER_ROOT_DOCUMENT_PATH=/home/andrew/Hosts
DOMAIN="" # ".lh"
OWNER='andrew:andrew'
@connected
connected / validation.js
Created February 8, 2014 14:31
jQuery from validation plugin default configuration for my projects
$.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);
@connected
connected / services.js
Last active December 30, 2015 22:59 — forked from Mithrandir0x/gist:3639232
Angular services example
// 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!"