Hammer.js
This file contains hidden or 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
package se.hellsoft.simpleservicecallbackdemo; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Intent; | |
import android.content.ServiceConnection; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.os.IBinder; |
This file contains hidden or 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
var myScript = document.createElement('script'); | |
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js'; | |
myScript.onload = function() { | |
console.log('jQuery loaded.'); | |
}; | |
document.body.appendChild(myScript); |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
This file contains hidden or 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
export ORG_ALIAS='DummyScratchOrg' | |
export PROJECT_NAME='DummyProject' | |
export PERMISSION_SET='DummyPermSet' | |
export IMPORT_PLAN='Dummy-plan.json' | |
# Create a Salesforce DX project | |
sfdx force:project:create -n $PROJECT_NAME | |
# Regist development/sandbox org | |
sfdx force:auth:web:login [-d] -a $ORG_ALIAS |
This file contains hidden or 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
List<CronTrigger> listCronTrigger = [select Id, CronExpression, EndTime, NextFireTime, OwnerId, PreviousFireTime, StartTime, State, TimesTriggered, TimeZoneSidKey from CronTrigger where State = 'Waiting' or State='Running']; | |
System.debug('No of jobs: '+listCronTrigger.size()); | |
if (listCronTrigger.size() > 0) { | |
for (Integer i = 0; i < listCronTrigger.size(); i++){ | |
System.abortJob(listCronTrigger[i].Id); | |
System.debug('Job details ::'+String.valueOf(listCronTrigger[i])); | |
} | |
} |
This file contains hidden or 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
@isTest static void User_can_get_contact_email() | |
{ | |
// Arrange | |
System.runAs(createUser()) | |
{ | |
// Act | |
// Assert | |
system.assertEquals('[email protected]', contact.Email, 'Email does not match'); | |
} |
This file contains hidden or 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
var Books = Backbone.Collection.extend({ | |
// Lets create function which will return the custom URL based on the method type | |
getCustomUrl: function (method) { | |
switch (method) { | |
case 'read': | |
return 'http://localhost:3000/api/Books/' + this.id; | |
break; | |
case 'create': | |
return 'http://localhost:3000/api/Books'; | |
break; |
This file contains hidden or 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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
OlderNewer