Skip to content

Instantly share code, notes, and snippets.

@jhersh
jhersh / aliases.zsh
Last active August 29, 2015 14:06
Git get & put
# Current branch name
alias gbr='git symbolic-ref --short HEAD'
alias gs='git status -sb'
# Fetch and rebase on top of the current branch from origin.
# Optionally specify a single argument as the name of the branch to rebase upon.
#
# Suppose you're on master.
# `gget` will fetch origin's master and rebase your current commits on top of origin.
#
source 'SPLSpecs' # private Splinesoft specs
source 'master'
platform :ios, '8.0'
xcodeproj 'Mudrammer'
deployment_target = '7.0'
# Splinesoft
@jhersh
jhersh / crash.php
Created January 14, 2014 00:46
Crashlytics -> PushOver
<?php
/**
* This script accepts a JSON payload from Crashlytics and forwards it to pushover,
* so you get a push notification when your app has a new crash!
*
* 1. Put this script on a server somewhere.
* 2. Fill in your pushover token and user keys.
* 3. Set up a web hook in Crashlytics with the URL to this script.
*/
@jhersh
jhersh / LikeBOMB
Created October 30, 2012 17:32
Spam likes on all posts and comments for a given Chatter user
javascript:var c=0;var s=Sfdc;var d=document;var sel="getSelection";var user=prompt("Enter User Name:",d[sel]&&d[sel]().toString()||"John Buchanan");var each=function(list,delegate){for(var i=0;i<list.length;i++)delegate(list[i])};var text=function(x){return x&&(x.textContent||x.innerText)||''};var match=function(delegate){return function(x){if(text(x)==user){delegate(x);}}};var click=function(x){if(x.style.display=='none')return;c++;x.onclick();};each(s.select(".feeditempreamble .actorentitylink"),match(function(x){each(s.select(".feeditemfooter .cxallfeedactions .cxlikeitemaction",s.Dom.getParent(x,".feeditemcontent")),click)}));each(s.select(".feedcommentuser"),match(function(x){each(s.select(".feeditemcommentbody .feedcommentactions .cxallfeedactions .cxlikecommentaction",s.Dom.getParent(x,".feeditemcomment")),click)}));alert(c+" new Likes!");undefined;
@jhersh
jhersh / ServiceRequestTrigger.java
Created May 31, 2012 18:36 — forked from pcon/ServiceRequestTrigger.java
Checking previous status != 'In Review' and then switched to 'In Review' - field expression now allowed for generic SObject line 33
public class ServiceRequestTrigger {
private final Map<Id, Service_Request__c> oldMap;
private final Map<Id, Service_Request__c> newMap;
private final List<Service_Request__c> newObjs;
private final Boolean isInsert;
private final Boolean isUpdate;
private final Boolean isDelete;
private final Boolean isBulk;
/**
trigger ApplyAssignmentRules on Lead (after insert) {
List<User> owner = [Select u.Id From User u where Name = 'User Portal' limit 1];
if( owner.isEmpty() )
return;
List<Lead> LeadsToUpdate = new List<Lead>();
For (Lead l:trigger.new)