Skip to content

Instantly share code, notes, and snippets.

@AgataJot
AgataJot / gist:4c97075fa39596852454
Last active October 11, 2015 07:43
Modiefied Standard Firmata for pins comms
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
/*
Firmata is a generic protocol for communicating with microcontrollers
from software on a host computer. It is intended to work with
any host computer software package.
To download a host software package, please clink on the following link
to open the download page in your default browser.
@AgataJot
AgataJot / sketch-switch-send.ino
Created September 27, 2015 07:14
Arduino code to tx to wireless socket switch
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
byte inByte = 0;
void setup() {
Serial.begin(9600);
// Transmitter is connected to Arduino Pin #10
mySwitch.enableTransmit(2);
### Keybase proof
I hereby claim:
* I am AgataJot on github.
* I am agata (https://keybase.io/agata) on keybase.
* I have a public key whose fingerprint is 74DB 87D4 72D7 5CD6 4116 EDA7 5B61 79BB 6B48 925D
To claim this, I am signing this object:
@AgataJot
AgataJot / detectIE
Created July 9, 2015 09:32
detect IE
function detectIE() {
if (typeof window === 'undefined') {
return true;
}
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
// IE 10 or older => return version number
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
function getRandomColor() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
@AgataJot
AgataJot / dabblet.css
Last active August 29, 2015 14:11 — forked from LeaVerou/dabblet.css
Untitled
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */
position: absolute;
opacity: 0;
}
:root input[type="checkbox"].ios-switch + div {
display: inline-block;
vertical-align: middle;
width: 3em; height: 1em;
border: 1px solid rgba(0,0,0,.3);
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@AgataJot
AgataJot / phantom.scss
Created October 20, 2012 03:22 — forked from StanAngeloff/phantom.scss
Compass Magick + PhantomJS = ♥
@import 'compass';
$theme1: red;
$theme2: maroon;
$button_width: 320px;
$button_height: 24px;
a {
background: #fff magick-sprite('button', magick-phantom($button_width, $button_height,
@AgataJot
AgataJot / sublime-js-console-log-snippet
Created October 14, 2012 15:36
Sublime Text 2 console log snippet
<snippet>
<content><![CDATA[console.log("$1", $2);]]></content>
<tabTrigger>log</tabTrigger>
<scope>source.js</scope>
<description>console.log ()</description>
</snippet>
@AgataJot
AgataJot / gist:2372542
Created April 13, 2012 01:12 — forked from paulirish/gist:438326
10 things i learned from the jquery source
/*
.d dP"Yb 888888 88 88 88 88b 88 dP""b8 .dP"Y8
.d88 dP Yb 88 88 88 88 88Yb88 dP `" `Ybo."
88 Yb dP 88 888888 88 88 Y88 Yb "88 o.`Y8b
88 YbodP 88 88 88 88 88 Y8 YboodP 8bodP'