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
dusty-mac:functionalmockups dustycandland$ nodester appnpm install express | |
nodester info Checking config.. | |
nodester ERRO no packages to install |
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 default_image_fu image, default_image_path, geometry=nil, options={} | |
if image.present? | |
image_fu image, geometry, options | |
else | |
image_tag default_image_path | |
end | |
end |
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 shorten(description, length) | |
return truncate(description.gsub(/(<[^>]+>)/, ''), :length => length, :omission => "...") | |
end |
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_for(@user, :html => {:multipart => true}) do |f| %> | |
... # Note that field_for needs <%= not just <% | |
<div class='field'> | |
<%= f.fields_for :avatar, Image.new do |a| %> | |
<%= a.label :'image' -%><br/> | |
<%= image_fu @user.avatar, '150x150' if @user.avatar %><br/> | |
<%= a.file_field :'image' %> | |
<% #a.hidden_field :'retained_image_id' %> |
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
update wp_options set option_value = 'http://localhost' where option_name = 'siteurl'; | |
GRANT ALL PRIVILEGES ON database.* TO 'user_name'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; | |
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
require 'savon' | |
client = Savon::Client.new do | |
wsdl.document = 'http://127.0.0.1/services/ContentManager.asmx?WSDL' | |
end | |
response = client.request :get_folders, "xmlns" => "http://mycontentservice.com/contentmanagerapi/" do |soap, wsdl| | |
soap.version = 2 | |
soap.body = { :apikey => "xxxxxxxxxxxxx" } | |
end |
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
#!/usr/bin/env rake | |
# Add your own tasks in files placed in lib/tasks ending in .rake, | |
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | |
#The original rails rakefile loading | |
def load_rails_environment | |
require File.expand_path('../config/application', __FILE__) | |
require 'rake' | |
MyApp::Application.load_tasks |
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
(ns middleman.jetty-logger | |
) | |
(import org.eclipse.jetty.util.log.Logger) | |
;; void debug(String msg, Object... args) | |
;; void debug(String msg, Throwable thrown) | |
;; void debug(Throwable thrown) | |
;; void ignore(Throwable ignored) | |
;; void info(String msg, Object... args) | |
;; void info(String msg, Throwable thrown) |
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
;; (require '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre]) | |
(defn with-free-port! | |
"Attempts to kill any current port-binding process, then repeatedly executes | |
nullary `bind-port!-fn` (which must return logical true on successful | |
binding). Returns the function's result when successful, else throws an | |
exception. *nix only. | |
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu." | |
[port bind-port!-fn & {:keys [max-attempts sleep-ms] |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer