Skip to content

Instantly share code, notes, and snippets.

var name = 'MyComponent';
var hash = btoa(JSON.stringify({
componentDef: "one:auraContainer",
attributes: {
values: {
tag: "c:" + name,
t: Date.now()
}
}
}));
@mino0123
mino0123 / gist:8571648
Created January 23, 2014 02:16
fieldsのガバナ制限カウント調査
System.debug(Account.Name.getDescribe().isCreateable()); // fields書いてない。カウントされない。当然。
System.debug(SObjectType.Account.fields.getMap()); // Mapの取得はカウントされる。当然。
System.debug(Account.fields.Name.getDescribe().isCreateable()); // fields書いてもこれはカウントされない
System.debug(SObjectType.Account.fields.Name.isCreateable()); // カウントされる。
System.debug(SObjectType.Account.fields.Name.isCreateable()); // 同じ項目の2回目はカウントされない。
System.debug(SObjectType.Account.fields.CreatedDate.isCreateable());// 別の項目はカウントされる。

Untitled Slide

glide.jsの264行目、 引数としてeventがないせいでグローバルにeventがないFirefoxだとエラーになる。

      ($('.setsettings')).on('click', function() {
        var data,
          _this = this;
 event.preventDefault();
@mino0123
mino0123 / DataAttribute.page
Last active December 19, 2015 02:28
Visualforceでdata-*使ってみる
<apex:page standardController="Account" recordSetVar="accounts" doctype="html-5.0">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<input type="button" onclick="alertSelectedIds();" value="Show Selected Id" />
</apex:pageBlockButtons>
<apex:pageBlockTable var="acc" value="{!accounts}" rows="20">
<apex:column >
<input type="checkbox" data-rid="{!acc.Id}" class="itemSelect"/>
</apex:column>
@mino0123
mino0123 / gist:5780014
Last active December 18, 2015 11:59
QueryResultが持つ日時型項目に同じ値を入力した後でも==比較でfalseになる
Event ev = [SELECT StartDateTime FROM Event LIMIT 1];
Event cloned1 = ev.clone(true, true, true, true);
ev.StartDateTime = ev.StartDateTime;
Event cloned2 = ev.clone(true, true, true, true);
System.debug(ev == cloned1);//=>false
System.debug(ev == cloned2);//=>true
ev.StartDateTime = DateTime.newInstance(
// ==UserScript==
// @id 200jsok
// @name 200jsok
// @description 404 Blog Not Found のJSをFirefoxでも動くようにする、多分たった一つのユーザースクリプト
// @include http://blog.livedoor.jp/dankogai/*
// @run-at document-end
// ==/UserScript==
var script = document.createElement('script');
public class FieldMapTest {
public Map<String, SObjectField> src { get; set; }
public Map<String, SObjectField> cloned { get; set; }
{
SObjectType t = ns__CustomObject1__c.SObjectType;
src = t.getDescribe().fields.getMap();
cloned = new Map<String, SObjectField>();
for (String key : src.keySet()) {
cloned.put(key, src.get(key));
}
/**
* with/without sharing について、
* 呼び出し元と実行クラスのどちらが優先されるかの調査。
**/
@isTest
private class SharingTest {
static Integer userCount = 0;
public static User newTestUser(String profileId) {
Integer count = userCount++;
@mino0123
mino0123 / gist:2778640
Created May 24, 2012 00:42
Id付insertエラー
var so = new sforce.SObject('Account');
so.Name = 'TestAccount';
so.Id = '001A00000000000';
var results = sforce.connection.create([so]);
console.log(results[0].errors);
//=> {
// fields: 'Id',
// message: 'cannot specify Id in an insert call',
// statusCode: 'INVALID_FIELD_FOR_INSERT_UPDATE'
//}
@mino0123
mino0123 / ApexCSIAPI.js
Created December 13, 2011 08:00
ApexCSIAPI
var Util = {
hasAllProperties: function (obj, props) {
for (var i = 0, len = props.length; i < len; i++) {
if (! (props[i] in obj)) {
return false;
}
}
return true;
},
post: function post(url, params, onload) {