This file contains 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
import java.awt.*; | |
import java.util.Random; | |
// For Mac devices accessibility needs to be turned on (in System Preferences) for the parent process that runs this program. | |
public class Main { | |
public static void main(String[] args) throws AWTException { | |
int min = 0; | |
GraphicsDevice defaultScreenDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); | |
int maxX = defaultScreenDevice.getDisplayMode().getWidth(); | |
int maxY = defaultScreenDevice.getDisplayMode().getHeight(); |
This file contains 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
// ==UserScript== | |
// @name Disable eval to get rid of annoying malware popups | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http*://*/* | |
// @exclude http*://*.google.com/* | |
// @run-at document-start | |
// @grant none |
This file contains 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
int spaces = 20 | |
int progress = 100 | |
(progress + 1).times { | |
// String * int is a shortcut to repeat string that many times | |
String hash = "#" * Math.ceil((it*spaces)/100.0); | |
// Carraige return (\r) returns the cursor to first character in line, overwriting other characters | |
print(String.format("[%-" + spaces + "s] %d%s\r", hash, it, '%')) | |
This file contains 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
// ==UserScript== | |
// @name Business standard anti-adblock | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://www.business-standard.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains 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
// ==UserScript== | |
// @name TOI Adblock pop-up override | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://*.indiatimes.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains 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
Camera is great but finding app was difficult. Also, sharing what I did do the configuration right: | |
App: | |
- Download from Xiaomi market app from app.mi.com (http://app.mi.com/getAppstoreApkUrl) | |
- Login to market using Mi account | |
- In Xiaomi market app search for the string: 小蚁智能摄像机 | |
- Download the first app from the store, It should show "Yi Home" | |
Firmware: | |
- Don't upgrade the firmware beyond 1.8.5.1L_201510301024 |
This file contains 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
# A sample R script that accpets command line argumenst | |
args <- commandArgs(trailingOnly = TRUE) | |
print(args) |
This file contains 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
def xsdFiles = [] | |
//create input stream for common xsd | |
def common = new StreamSource(new FileInputStream("common.xsd")) | |
xsdFiles.add(common) | |
def common1 = new StreamSource(new FileInputStream("common1.xsd")) | |
xsdFiles.add(common1). | |
. | |
. | |
def common100 = new StreamSource(new FileInputStream("common100.xsd")) | |
xsdFiles.add(common100)//here, common1...100.xsd are imported in sample.xsd. so, common1..100.xsd must be before sample.xsd |