Skip to content

Instantly share code, notes, and snippets.

View rsrini7's full-sized avatar
😃
Happy

Srinivasan Ragothaman rsrini7

😃
Happy
View GitHub Profile
@rsrini7
rsrini7 / FirmataWithDHTAndIRemote.cpp
Created August 14, 2018 12:59 — forked from gautamdhameja/FirmataWithDHTAndIRemote.cpp
Arduino - here’s how to integrate DHT and IRemote libraries with Standard Firmata to read temperature and infrared sensors and send data using Firmata.sendString()
/*
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 list of Firmata client libraries your default browser.
https://github.com/firmata/arduino#firmata-client-libraries
@rsrini7
rsrini7 / check-proxy.py
Created July 23, 2018 09:44 — forked from mgeeky/check-proxy.py
Windows Proxy Auto-detection and debugging script crafted by Juan Caillava (https://medium.com/@br4nsh/a-meterpreter-and-windows-proxy-case-4af2b866f4a1)
import ctypes
import ctypes.wintypes
import sys
class WINHTTP_CURRENT_USER_IE_PROXY_CONFIG(ctypes.Structure):
_fields_ = [("fAutoDetect", ctypes.wintypes.BOOL),
("lpszAutoConfigUrl", ctypes.wintypes.LPWSTR),
("lpszProxy", ctypes.wintypes.LPWSTR),
("lpszProxyBypass", ctypes.wintypes.LPWSTR)]
@rsrini7
rsrini7 / WarGames.js
Created January 1, 2018 09:54 — forked from gingemonster/WarGames.js
Micromonsters Episode 7 - WarGames code
let opponentsmissile: game.LedSprite = null
let missile: game.LedSprite = null
let switchxposition = 0
let player = game.createSprite(2, 4)
let nummissles = 0
input.onButtonPressed(Button.A, () => {
player.change(LedSpriteProperty.X, -1)
})
input.onButtonPressed(Button.B, () => {
player.change(LedSpriteProperty.X, 1)
@rsrini7
rsrini7 / !README.md
Created October 26, 2017 07:36 — forked from phansson/!README.md
SafeHtml utility class for making strings safe to use in HTML

SafeHtml

This small Java class is a utility class for escaping strings so that they are safe to use in HTML. There's a single static method, htmlEscape(), which does the job.

I've found that all existing solutions (libraries) I've reviewed suffered from one or several of the below issues:

  • They escape too much ... which makes the HTML much harder to read and takes longer time.
  • They don't tell you in the Javadoc exactly what they replace.
  • They do not document when the returned value is safe to use (safe to use for an HTML entity?, for an HTML attributute?, etc)
@rsrini7
rsrini7 / Node-RED example flow
Created April 10, 2017 10:36 — forked from dexterlabora/Node-RED example flow
An example of how PubNub messages can be sent and received to interact with the IoL City. www.InternetOfLego.com
[{"id":"a0f49a5c.5f0b68","type":"pubnub-keys","pub_key":"XXXX","sub_key":"XXXX"},{"id":"490810ab.b6f7f","type":"pubnub in","keys":"a0f49a5c.5f0b68","channel":"iol","x":94,"y":86,"z":"11e87d2f.ee1783","wires":[["1e0d1490.e1f2eb","1bd186c1.e42e79"]]},{"id":"965d4cc1.69a2b","type":"pubnub out","keys":"a0f49a5c.5f0b68","channel":"iol","x":656,"y":405,"z":"11e87d2f.ee1783","wires":[]},{"id":"1e0d1490.e1f2eb","type":"debug","name":"PubNub raw data","active":false,"console":"false","complete":"payload","x":337,"y":44,"z":"11e87d2f.ee1783","wires":[]},{"id":"e91c1b55.16e3e8","type":"inject","name":"","topic":"","payload":"From node-red, Hello World!","payloadType":"none","repeat":"","crontab":"","once":false,"x":140,"y":301,"z":"11e87d2f.ee1783","wires":[["20132ddb.dfecd2"]]},{"id":"fe4f5cf0.01b0a","type":"inject","name":"","topic":"","payload":"{command:lights_off}","payloadType":"none","repeat":"","crontab":"","once":false,"x":142,"y":365,"z":"11e87d2f.ee1783","wires":[["40213340.bfdecc"]]},{"id":"20132ddb.dfecd2",
@rsrini7
rsrini7 / Map.scala
Created April 1, 2017 20:45 — forked from anonymous/Map.scala
Scala Dojo - ThoughtWorks
package ashcloud
class Map(val lines: Int, val columns: Int) {
var airports: Seq[(Int,Int)] = Seq()
var clouds: Seq[(Int,Int)] = Seq()
def addAirports(coordinates: Seq[(Int,Int)]) {
airports = airports ++ coordinates
}
AR \ BC | Check in | Drop L. | Passp. C | Board | Transit |
----------+----------+---------+----------+-------+---------+
Passenger | Y | | Y | Y | |
----------+----------+---------+----------+-------+---------+
Luggage | Y | Y | | | Y |
----------+----------+---------+----------+-------+---------+
Flight | Y | | | | |
----------+----------+---------+----------+-------+---------+
Three bounded contexts:
function render() {
aleph = Blockly.svg.cloneNode(true);
aleph.removeAttribute("width");
aleph.removeAttribute("height");
aleph.removeChild(aleph.children[0]);
aleph.removeChild(aleph.children[1]);
aleph.removeChild(aleph.children[1]);
if (aleph.children[0].children[1].children[0] !== undefined) {
aleph.children[0].removeChild(aleph.children[0].children[0]);
aleph.children[0].children[0].removeAttribute("transform");
@rsrini7
rsrini7 / ChangePassword.java
Created January 28, 2017 09:01 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{