Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| :+1: | |
| :-1: | |
| :airplane: | |
| :art: | |
| :bear: | |
| :beer: | |
| :bike: | |
| :bomb: | |
| :book: | |
| :bulb: |
| # Pass in the name of the site you wich to create a cert for | |
| domain_name = ARGV[0] | |
| if domain_name == nil | |
| puts "Y U No give me a domain name?" | |
| else | |
| system "openssl genrsa -out #{domain_name}.key 1024" | |
| system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'" | |
| system "cp #{domain_name}.key #{domain_name}.key.bak" |
| # == Active Model North American Telephone Number Validator | |
| # http://en.wikipedia.org/wiki/North_American_Numbering_Plan#Current_system | |
| # [Author] Roger Rohrbach ([email protected]) | |
| class NanpValidator < ActiveModel::EachValidator | |
| def self.matcher(require_area_code) # :nodoc: | |
| %r{ | |
| (?<country_code> \+1 ){0} | |
| (?<trunk_prefix> 1 ){0} | |
| (?<delimiter> ([-\.]|\ +) ){0} |
| # lib/api/presenters/detailed_post.rb | |
| module API | |
| module Presenters | |
| class DetailedPost | |
| include ActiveModel::Serializers::JSON | |
| include ActiveModel::Serializers::Xml | |
| attr_accessor :post | |
| delegate :attributes, :to => :post |
| require "logger" | |
| configure do | |
| LOG = Logger.new(STDOUT) | |
| LOG.level = Logger.const_get ENV['LOG_LEVEL'] || 'DEBUG' | |
| LOG.info 'I am logging something.' | |
| end |
| var oldSync = Backbone.sync; | |
| Backbone.sync = function(method, model, options){ | |
| options.beforeSend = function(xhr){ | |
| xhr.setRequestHeader('X-CSRFToken', CSRF_TOKEN); | |
| }; | |
| return oldSync(method, model, options); | |
| }; |
| # encoding: utf-8 | |
| module Nanoc3::Filters | |
| class AbsolutizePaths < Nanoc3::Filter | |
| identifier :absolutize_paths | |
| require 'nanoc3/helpers/link_to' | |
| include Nanoc3::Helpers::LinkTo | |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| --colour | |
| -I app |