Skip to content

Instantly share code, notes, and snippets.

View dlisovsky's full-sized avatar
💡
Focusing

Dmitry Lisovsky dlisovsky

💡
Focusing
View GitHub Profile
@tarot
tarot / DateFormat.cls
Last active February 19, 2020 16:09
Apexでhttp-date (RFC1123)
public class DateFormat {
private static final Map<String, Integer> MONTHS = new Map<String, Integer> {
'Jan' => 1, 'Feb' => 2, 'Mar' => 3, 'Apr' => 4, 'May' => 5, 'Jun' => 6,
'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec' => 12
};
public static Datetime fromRFC1123(String x) {
String[] dateParts = x.split('[\\s:]');
Integer year = Integer.valueOf(dateParts[3]);
@omugura
omugura / Utility.cls
Created December 24, 2015 01:27
html header
public class Utility{
public static String getUrl(){
return ApexPages.currentPage().getUrl();
}
public static String getIpAddress(){
return ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
}
public static String getUserAgent(){
return ApexPages.currentPage().getHeaders().get('USER-AGENT');
}
@dlisovsky
dlisovsky / dto.js
Last active November 18, 2019 19:33
Donate page initial dto
{
"dto": {
"recurring": {
"amounts": [
{
"description": "Huge Support",
"amount": 50,
"isEnabled": true
},
{