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
// | |
// Base58 Encode/Decode Trait for PHP | |
// ================================== | |
// Base58 is like Base62 except that it removes certain problematic characters such as 0, O, I, and l. | |
// This is great if you need the encoded output to be easily human-readable. Like short URLs... | |
// | |
trait Base58 { | |
private $alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; |
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
@mixin respond_to($device) { | |
@if $device == handheld { | |
@media only screen and (max-width: 767px) { | |
@content | |
} | |
} @else if $device == handheld-landscape { | |
@media only screen and (max-width: 767px) and (orientation: landscape) { | |
@content | |
} | |
} @else if $device == handheld-portrait { |
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 User < ActiveRecord::Base | |
respond_to :html, :json, :xml | |
def show | |
respond_with @user = User.find(params[:id]), :except => [:password, :email] | |
end | |
end |
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
validates :ga, :format => { :with => /^UA-[1-9]+-[1-9]+$/x } |
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 Website < ActiveRecord::Base | |
validates :domain, :format => { :with => /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix } | |
end |
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
$('#new_file').submit(function(e) { | |
e.preventDefault(); | |
var $this = $(this); | |
var file = this.files[0]; | |
console.log("The file is " + file.fileName + '::' + file.size + '--' + file.type); | |
function progess_status(event) { | |
var percent = Math.round(event.loaded / event.total * 100); | |
console.log(percent); | |
} | |
function upload_complete(event){ |
NewerOlder