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
private static String toHexString(byte[] bytes) { | |
Formatter formatter = new Formatter(); | |
for (byte b : bytes) { | |
formatter.format("%02x", b); | |
} | |
return formatter.toString(); | |
} | |
public static String generateHMAC(String path, String body, String key) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException { | |
SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); |
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
@mixin tooltip($text, $top: 0px, $left: 0px) { | |
&:hover::after { | |
$top: $top - 7px; | |
$left: $left - 10px; | |
content: quote($text); | |
position: absolute; | |
@include transition(all, 0.3s); | |
@include linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8), transparent); | |
border-radius: 20px; |
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
.treeview { | |
& > ul > li:first-of-type { | |
& > span { | |
padding-left: 12px !important; | |
} | |
&::before { | |
content: ''; | |
position: absolute; | |
width: 10px; |
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
@mixin linear-gradient($a, $b: false, $c: false, $d: false, $e: false, $f: false, $g: false) { | |
$value: $a; | |
@each $var in $b, $c, $d, $e, $f, $g { | |
@if $var { | |
$value: $value + ', ' + $var; | |
} | |
} | |
$value: unquote($value); | |
@include value-prefix('background', "linear-gradient(" + $value + ")"); | |
} |
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
$ = jQuery | |
jQuery.fn.number = (options) -> | |
defaults = | |
min: null | |
max: null | |
step: 1 | |
pattern: /^(-?[0-9\.]*)$/ | |
default_prefix: '' | |
default_suffix: '' | |
change_on_click: true |
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
diff --git a/laravel/validator.php b/laravel/validator.php | |
index 0c84e8e..1a09bff 100644 | |
--- a/laravel/validator.php | |
+++ b/laravel/validator.php | |
@@ -584,7 +584,7 @@ class Validator { | |
*/ | |
protected function validate_alpha($attribute, $value) | |
{ | |
- return preg_match('/^([a-z])+$/i', $value); | |
+ return $this->validate_match($attribute, $value, 'a-z'); |
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
div { | |
background: #f00; | |
-webkit-transition: background 1000s linear; | |
-moz-transition: background 1000s linear; | |
transition: background 1000s linear; | |
} | |
div:hover { | |
background: #00f; | |
-webkit-transition: 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
@function mod($l, $r) { | |
@while ($l - $r) >= 0 { | |
$l: $l - $r; | |
} | |
@return abs($l); | |
} | |
@for $i from 1 through 100 { | |
#{$i} { | |
@if mod($i, 3) == 0 and mod($i, 5) == 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 | |
Route::filter('after', function($response) | |
{ | |
$format = Input::get('format', Config::get('application.default_mutator')); | |
$response->mutator = $format; | |
}); | |
Route::mutator('string', function($response) { |
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
@function mix-alpha($color, $bg) { | |
@return mix(opacify($color, 1), opacify($bg, 1), alpha($color) * 100); | |
} | |
@mixin safe-color($color, $bg) { | |
background: mix-alpha($color, $bg); | |
background: $color; | |
} | |
body { |
OlderNewer