gem install rails --pre
rails new my_app -T
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
/* | |
MIT LICENSE | |
Copyright 2011 Jon Leighton | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
Generate a new Elixir project using mix
and add cowboy
and plug
as dependencies in mix.exs
:
defp deps do
[
{:cowboy, "~> 1.0.0"},
{:plug, "~> 0.8.1"}
]
end
protected override void afterInsert() { | |
boolean isSuccessfulRun = false; | |
for(Integer i=0; i < Trigger.new.size() && isSuccessful == false; i++){ | |
isSuccessfulRun |= (((DL__c)Trigger.new.get(i)).Status__c == 'Completed'); | |
} | |
if(isSuccessfulRun){ | |
//Kick off batch jobs | |
Database.executeBatch(new MyNotSoFirstBatchJob(),50); | |
} |
/** | |
* Sleep at least a second | |
* | |
* Found at: http://boards.developerforce.com/t5/Apex-Code-Development/Best-way-to-delay-until-time-changes-in-a-test/td-p/389619 | |
* | |
*/ | |
public static void waitAtLeastASecond() { | |
Integer msPerS = 1000; | |
Datetime start = Datetime.now(); | |
Datetime current = Datetime.now(); |
if ( | |
and ( | |
YEAR(Date_Start__c) == YEAR(TODAY()), | |
IF( | |
CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7) > 52, | |
52, | |
CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7) | |
) == | |
IF( |
function getLocaleDateString(){ | |
var formats ={"ar-SA":"dd/mm/yy","bg-BG":"dd.m.yyyy","ca-ES":"dd/mm/yyyy","zh-TW":"yyyy/m/d","cs-CZ":"d.m.yyyy", | |
"da-DK":"dd-mm-yyyy","de-DE":"dd.mm.yyyy","el-GR":"d/m/yyyy","en-US":"m/d/yyyy","fi-FI":"d.m.yyyy","fr-FR":"dd/mm/yyyy", | |
"he-IL":"dd/mm/yyyy","hu-HU":"yyyy. mm. dd.","is-IS":"d.m.yyyy","it-IT":"dd/mm/yyyy","ja-JP":"yyyy/mm/dd", | |
"ko-KR":"yyyy-mm-dd","nl-NL":"d-m-yyyy","nb-NO":"dd.mm.yyyy","pl-PL":"yyyy-mm-dd","pt-BR":"d/m/yyyy", | |
"ro-RO":"dd.mm.yyyy","ru-RU":"dd.mm.yyyy","hr-HR":"d.m.yyyy","sk-SK":"d. m. yyyy","sq-AL":"yyyy-mm-dd", | |
"sv-SE":"yyyy-mm-dd","th-TH":"d/m/yyyy","tr-TR":"dd.mm.yyyy","ur-PK":"dd/mm/yyyy","id-ID":"dd/mm/yyyy", | |
"uk-UA":"dd.mm.yyyy","be-BY":"dd.mm.yyyy","sl-SI":"d.m.yyyy","et-EE":"d.mm.yyyy","lv-LV":"yyyy.mm.dd.", | |
"lt-LT":"yyyy.mm.dd","fa-IR":"mm/dd/yyyy","vi-VN":"dd/mm/yyyy","hy-Am":"dd.mm.yyyy","az-Latn-AZ":"dd.mm.yyyy", | |
"eu-ES":"yyyy/mm/dd","mk-mK":"dd.mm.yyyy","af-ZA":"yyyy/mm/dd","ka-GE":"dd.mm.yyyy","fo-FO":"dd-mm-yyyy", |
<apex:page controller="CustomerCommunityController" id="customercommunitycontroller" sidebar="false" showHeader="false" standardStylesheets="false" > | |
<head> | |
<title>Acme Customer Support</title> | |
<meta charset="utf-8" /> | |
<apex:includeScript value="{!$Resource.jquery}"/> | |
</head> | |
<script type="text/javascript"> | |
#put this in viewDidLoad | |
@hud = MBProgressHUD.alloc.initWithView(self.view) | |
@hud.animationType = MBProgressHUDAnimationZoom | |
self.view.addSubview(@hud) | |
@hud.show(true) |