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
class SubArraySum { | |
int[][] arr; | |
int[][] sums; | |
public SubArraySum(int[][] arr) { | |
this.arr = arr; | |
this.sums = new int[this.arr.length][this.arr[0].length]; | |
updateSums(); | |
} | |
private void updateSums() { |
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
/** | |
* Converts :hover CSS to :active CSS on mobile devices. | |
* Otherwise, when tapping a button on a mobile device, the button stays in | |
* the :hover state until the button is pressed. | |
* | |
* Inspired by: https://gist.github.com/rcmachado/7303143 | |
* @author Michael Vartan <[email protected]> | |
* @version 1.0 | |
* @date 2014-12-20 | |
*/ |
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
sudo echo " | |
lirc_dev | |
lirc_rpi gpio_in_pin=23 gpio_out_pin=22" >> /etc/modules | |
sudo /etc/init.d/lirc stop | |
sudo /etc/init.d/lirc start |
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
######################################################## | |
# /etc/lirc/hardware.conf | |
# | |
# Arguments which will be used when launching lircd | |
LIRCD_ARGS="--uinput" | |
# Don't start lircmd even if there seems to be a good config file | |
# START_LIRCMD=false | |
# Don't start irexec, even if a good config file seems to exist. |
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
/** | |
* app.js | |
* | |
* IR Remote Web Service | |
* | |
* @author Michael Vartan | |
* @version 1.0.0 | |
*/ | |
var express = require('express'); |
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
mkdir TO_PRINT | |
echo "Merging all $1" | |
for f in $1; do vim -f +"syn on" +"TOhtml" +"wq" +"q" $f; echo '<style>*{font:9pt menlo !important;}</style>' >> $f.html; mv $f.html TO_PRINT; done | |
wkhtmltopdf TO_PRINT/*.html TO_PRINT.pdf | |
rm -rf TO_PRINT | |
open TO_PRINT.pdf |