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
<input type="number" pattern="\d+" /> |
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
<html ng-app='test'> | |
<head> | |
<title>touch test</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" /> | |
<style> | |
button { | |
width: 100%; | |
-webkit-tap-highlight-color: transparent; | |
} | |
</style> |
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
$ curl -v http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js 2>&1 | less | |
* Hostname was NOT found in DNS cache | |
* connect to 127.0.0.1 port 80 failed: Connection refused | |
* Trying 2607:f8b0:4010:801::100d... | |
* Connected to pagead2.googlesyndication.com (2607:f8b0:4010:801::100d) port 80 (#0) | |
> GET /pagead/js/adsbygoogle.js HTTP/1.1 | |
> User-Agent: curl/7.37.1 | |
> Host: pagead2.googlesyndication.com | |
> Accept: */* |
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 _ = require('lodash'); | |
var hard = [ '6 2 3 ', | |
' 2 7 8', | |
' 9 4 ', | |
' 6 3 ', | |
'8 1', | |
' 7 4 ', | |
' 6 9 ', | |
'4 3 2 ', |
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
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" type="text/css" /> | |
<style type="text/css"> | |
.table-frozen { | |
position: relative; | |
} | |
.table-frozen .col-frozen { | |
background-color: white; | |
} | |
</style> |
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/sh | |
# like `git`, but for typos (e.g. `gi tbranch -a`) | |
git "${1:1}" "${@:2}" |
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
# | |
# <%= form.select_time :start, :meridian => true %> | |
# | |
module ActionView | |
module Helpers | |
class DateTimeSelector | |
def select_time_with_meridian | |
html = select_time_without_meridian | |
if @options[:meridian] | |
id = input_id_from_type(:hour) |
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 helper function to create more dynamic object literals | |
// $h('key'+i, value) => { key1: value } | |
var $h = function() { | |
var constructor = function() { | |
var k = null, args = arguments[0]; | |
for (var i = 0; i < args.length; i++) { | |
if (k == null) { | |
k = args[i]; | |
} else { | |
this[k] = args[i]; |
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 editor = new Ajax.InPlaceEditor('chart_name', '', { | |
okControl: false, | |
cancelControl: false, | |
submitOnBlur: true, | |
highlightcolor: 'transparent' | |
}); | |
// override the bound submit handler function to prevent | |
// the control from actually submitting to a url and instead | |
// do something more useful with the edit. | |
editor._boundSubmitHandler = function(e) { |
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 self.max_allowed_packet | |
r = connection.execute "SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet'" | |
r.fetch_row.last.to_i rescue 128.megabytes | |
end | |
validates_length_of :data, :in => 1 .. max_allowed_packet, | |
:allow_blank => true | |
validates_length_of :file, :in => 1 .. max_allowed_packet, | |
:allow_blank => true |