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
var Substring = function(s, e) { | |
this.s = s; | |
this.e = e; | |
this.l = e - s; | |
}; | |
var longestPalindromeFromOffset = function(s, i) { | |
var j, | |
long = new Substring(0, 1); | |
for (j = 1; (j <= (s.length - i)) && ((i - j) >= 0); j++) { |
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
#!/bin/bash | |
LENGTH=16 | |
if [ "$#" -gt 0 ]; then | |
LENGTH="$1" | |
fi | |
# from: https://gist.github.com/earthgecko/3089509 | |
RESULT=`cat /dev/urandom \ | |
| LC_CTYPE=C tr -dc 'a-zA-Z0-9-.?~!@#$%^&*' \ |
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
gem 'sassc', '~> 1.7.1' | |
gem 'sassc-rails', '~> 1.1.0' |
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
<?php | |
function remove_gremlins($str) { | |
$cleaned = ''; | |
for ($i = 0, $max = strlen($str); $i < $max; $i++) { | |
$char_str = substr($str, $i, 1); | |
$char = ord($char_str); | |
if (($char >= 32) || ($char == 13)) { // new line or printable chars | |
$cleaned .= $char_str; | |
} |
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
#!/bin/bash | |
# Make Internet connection fast again | |
sudo ipfw delete 1 | |
sudo ipfw delete 2 | |
sudo ipfw delete 3 | |
sudo ipfw delete 4 |
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
#!/bin/bash | |
dir="$HOME/capture" | |
output="$dir/output" | |
urls=`cat "$dir/list.txt"` | |
i=1 | |
for url in $urls; do | |
# Convert url to file name | |
path=`echo $url | sed -e 's/http:\/\/domain\.name\///g'` |
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
$root-font-size: 16px; | |
@mixin font($size, $line-height, $weight: null) { | |
font-size: $size; // IE fix | |
font-size: ($size / $root-font-size) * 1rem; | |
@if $weight != null { | |
font-weight: $weight; | |
} | |
line-height: $line-height; | |
} |
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 org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
import org.springframework.beans.factory.config.PropertyOverrideConfigurer; | |
public class BeanPropertyOverrideConfigurer extends PropertyOverrideConfigurer { | |
private String beanName; | |
public String getBeanName() { | |
return beanName; |
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
Index: CutyCapt.cpp | |
=================================================================== | |
--- CutyCapt.cpp (revision 10) | |
+++ CutyCapt.cpp (working copy) | |
@@ -363,6 +363,7 @@ | |
" --js-can-access-clipboard=<on|off> Script clipboard privs (default: unknown)\n" | |
#if QT_VERSION >= 0x040500 | |
" --print-backgrounds=<on|off> Backgrounds in PDF/PS output (default: off) \n" | |
+ " --no-background=<on|off> Transparent background (as opposed to white background) (default: off) \n" | |
" --zoom-factor=<float> Page zoom factor (default: no zooming) \n" |
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
#!/bin/bash | |
# This script wraps around mvn -ep to take password without it being revealed. | |
echo -n "Password: " | |
read -s password | |
echo "" | |
mvn -ep "$password" |
NewerOlder