Skip to content

Instantly share code, notes, and snippets.

//Use the SObject Rows resource to update records
Service.update = function(type, sfdcId, data, options) {
var postData = {
b: data,
q: '/' + sfVersion + '/sobjects/' + type + '/' + sfdcId
};
//
return $http.put(cmcSFProxyEndPoint, postData, {
transformRequest: function(data, headersGetter) {
#!/bin/bash
#search for all zip files and unzip them into a subfolder with the same name as the zip
zips=$(find . -name \*.zip -type f;)
echo $zips
for i in $zips
do
echo "--- "$i
#remove the .zip from the name, each i
m=$(echo $i | awk -F"." '{print substr($2,2)}')
echo $m
[tc@domU-12-31-39-06-40-96:~/jboss-4.0.4.GA/bin] tn
12:57:16,238 INFO [ProxyFactory] Bound EJB Home 'PolicyEJB' to jndi 'com.topcoder.security.policy.PolicyRemoteHome'
12:57:16,358 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'LoginEJB' to jndi 'java:/com.topcoder.security.login.LoginLocalHome'
12:57:16,361 INFO [ProxyFactory] Bound EJB Home 'LoginEJB' to jndi 'com.topcoder.security.login.LoginRemoteHome'
12:57:16,362 INFO [EJBDeployer] Deployed: file:/home/tc/jboss-4.0.4.GA/server/all/tmp/deploy/tmp41195security.ear-contents/security.jar
12:57:16,529 INFO [EARDeployer] Started J2EE application: file:/home/tc/jboss-4.0.4.GA/server/all/deploy/security.ear
12:57:17,188 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:58s:491ms
13:01:18,131 INFO [LDAPDBUserDataSynchronizationTask] Starting task iteration at Thu Jun 05 13:01:17 GMT-05:00 2014. Remaining repetitions: -1
13:01:18,134 INFO [LDAPDBUserDataSynchronizationTask] Finished task iter
@theWill
theWill / gist:b3252b132e0dcb171cc4
Created September 11, 2014 22:31
Estimator - query
// doing the DataService.getResourcesForEstimate to do a query against SFDC
// has a subquery for Estimate_Resource_Weeks__r that are returning results but the data is overwritten somehow
// if the DataService.getWeeksForEstimate block of code is commented out then the results come through correctly
// Note: this is not the orginal file but should be the relevant code needed...
DataService.getResourcesForEstimate(DataService.recordId).then(function (resources){
console.log("resources", resources)
//TODO - comment out this part causes the code to NOT lose data
DataService.getWeeksForEstimate(DataService.recordId).then(function (weeks){
## Single Page App
@TODO: provide rationale for SPA
Single html file
Uses 'latest' versions of Angular and Twitter bootstrap. Bootstrap has a dependency on jQuery so we will use that as well
### Versions
* Angular - v1.2.1-rc.3 (v1.2.7 is out as of 1/3/14)
* Bootstrap - v3.0.0 (v3.0.1 is out as of 10/30/13)
* jQuery - v1.10.2 (http://jquery.com/download/: Since IE 6/7/8 are still relatively common, we recommend using the 1.x version
unless you are certain no IE 6/7/8 users are visiting the site)
## Single Page App
@TODO: provide rationale for SPA
Single html file
Uses 'latest' versions of Angular and Twitter bootstrap. Bootstrap has a dependency on jQuery so we will use that as well
### Versions
* Angular - v1.2.1-rc.3 (v1.2.7 is out as of 1/3/14)
* Bootstrap - v3.0.0 (v3.0.1 is out as of 10/30/13)
* jQuery - v1.10.2 (http://jquery.com/download/: Since IE 6/7/8 are still relatively common, we recommend using the 1.x version
unless you are certain no IE 6/7/8 users are visiting the site)

Single Page App

@TODO: provide rationale for SPA Single html file Uses 'latest' versions of Angular and Twitter bootstrap. Bootstrap has a dependency on jQuery so we will use that as well

Versions

  • Angular - v1.2.1-rc.3 (v1.2.7 is out as of 1/3/14)
  • Bootstrap - v3.0.0 (v3.0.1 is out as of 10/30/13)
  • jQuery - v1.10.2 (http://jquery.com/download/: Since IE 6/7/8 are still relatively common, we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site)
{
"error": {
"name": "Not Found",
"value": 404,
"description": "The URI requested is invalid or the requested resource does not exist.",
"details": "statistics not found"
},
"serverInformation": {
"serverName": "TopCoder API",
"apiVersion": "0.0.1",
@theWill
theWill / gist:779f7f79b1743592042e
Created October 21, 2014 22:36
get_member_marathon_statistics
select c.handle
, ar.rating
, ar.num_competitions as competitions
, ROUND((select avg(lcr.placed) from long_comp_result lcr where lcr.coder_id = c.coder_id and attended='Y'),2) as avg_rank
, ROUND((select avg(lcr.num_submissions) from long_comp_result lcr where lcr.coder_id = c.coder_id and attended='Y'),2) as avg_num_submissions
, (select min(placed) from long_comp_result where placed > 0 and coder_id = c.coder_id) as best_rank
, (select count(*) from long_comp_result where placed =1 and coder_id = c.coder_id) as wins
, (select count(*) from long_comp_result where placed between 1 and 5 and coder_id = c.coder_id) as top_five_finishes
, (select count(*) from long_comp_result where placed between 1 and 10 and coder_id = c.coder_id) as top_ten_finishes
, cr.rank
@theWill
theWill / gist:33eaee6113d1c9a89cc9
Created October 21, 2014 22:38
get_member_marathon_statistics_history
SELECT
rr.round_id AS challenge_id
, r.short_name AS challenge_name
, to_char(cal.date, '%Y.%m.%d') AS date
, NVL(rr.new_rating, rr.old_rating) AS rating
, crh.rank AS placement
, TRIM(NVL(crh.percentile, 'N/A')) AS percentile
FROM round r
, calendar cal
, long_comp_result rr