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
client.getLocation({enableHighAccuracy: true}, function(err, position) { | |
if (err) { | |
// Could not retrieve location information. Check err for more information | |
} else { | |
// Latitude and longitude available in position.coords | |
} | |
}); |
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
# Inspired by https://gist.github.com/1332883 | |
module HerokuAutoscale | |
module Scaler | |
class << self | |
@@heroku = Heroku::Client.new( ENV['HEROKU_USER'], ENV['HEROKU_PASS'] ) | |
def workers | |
@@heroku.info(ENV['HEROKU_APP'])[:workers].to_i | |
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 parameters = [ title: "Basic", company:"Experience", location:"Boston", type: "Senior", salary: "80k", description: " BAsic desc", experience: "Experience", draft: "false", email: "[email protected]",industries: "Ind1, ind2", functions: "BB", experiences: "experiences",skills: "Skill1" ] | |
parameters.each{ | |
controller.params."${it.key}" = it.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
ids = HistoricalQuery.alive_queries_ids | |
HistoricalElement.not_in( query_id: ids ).delete_all |
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
String.format('%tB %<te %<tY', new Date()) |
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
<span class="subcategory"> | |
<input type="text" id="companyName" name="companyname" value="" style="WIDTH: 200px;"> | |
<span class="validate_job_company" style="margin:0px; padding:0px; color:red"></span> | |
<div class="delete_link" style="display: inline-table;"> | |
<a href="#" onclick="javascript:jQuery(this).parent().parent().parent().parent().remove();return false;" style="padding-top: 0px;">Remove</a> | |
</div> | |
</span> | |
.... |
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
copy <table name> from '/Users/charlypalencia/Desktop/<file).csv' using delimiters ','; |
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
# This is my projects function | |
PROJECTS_DIR="/Users/$(whoami)/Projects" | |
p() { | |
PROJECT_NAME="$1"; | |
if [ -d "$PROJECTS_DIR/$PROJECT_NAME" ]; then | |
cd "$PROJECTS_DIR/$PROJECT_NAME"; | |
else | |
echo "\n| ERROR: Hey! Project '$PROJECT_NAME' doesn't exist \n| please check the folder name exists inside your \$PROJECTS_FOLDER\n" | |
fi |
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
// Thanks to kouphax | |
RegExp.escape = function(str){ | |
var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); // .*+?|()[]{}\ | |
return str.replace(specials, "\\$&"); | |
} |
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
class Other { | |
def first = { | |
return list[0] | |
} | |
def hello(){ | |
return "hello ${ myName() }" | |
} | |
} |
OlderNewer