This file contains 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
git reset HEAD~1 --soft |
This file contains 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
Disable gulp-notify | |
If you are running on a system that handles notifications poorly or you simply do not wish to use gulp-notify but your project does? You can disable gulp-notify by using enviroment variable DISABLE_NOTIFIER. | |
export DISABLE_NOTIFIER=true; |
This file contains 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
# By default we use the Node.js version set in your package.json or the latest | |
# version from the 0.10 release | |
# | |
# You can use nvm to install any Node.js (or io.js) version you require. | |
# nvm install 4.0 | |
# rm -Rf node_modules | |
nvm install 0.10 | |
npm install -q | |
npm install -g [email protected] -q | |
npm install gulp -q |
This file contains 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
public class BadgeUtils { | |
public static void setBadge(Context context, int count) { | |
setBadgeSamsung(context, count); | |
setBadgeSony(context, count); | |
} | |
public static void clearBadge(Context context) { | |
setBadgeSamsung(context, 0); |
This file contains 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
#/bin/sh | |
# Creates a 1gb swap image. | |
# @see https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps | |
if [ -f /var/swap.img ]; then | |
echo "Swap file already exists." | |
else | |
touch /var/swap.img | |
chmod 600 /var/swap.img |
This file contains 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
x = document.getElementsByClassName("debugLogLink"); | |
y = decodeURIComponent(x[0].getAttribute("href")); | |
z = y.substring(y.indexOf("'")+1); | |
p = z.substring(0,z.indexOf("'")); | |
x[0].setAttribute("href",p); | |
x[0].setAttribute("target","_blank"); |
This file contains 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
import java.util.*; | |
import java.io.*; | |
import java.security.*; | |
public class ChangePassword | |
{ | |
private final static JKS j = new JKS(); | |
public static void main(String[] args) throws Exception | |
{ |
This file contains 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
# search for feed items that match text and are parented by record_id, | |
# e.g. a specific group or record feed. page_size must be a number between | |
# 1 and 100. This method doesn't handle paging, so in most cases you'll want to also | |
# add a page parameter to the query and continue to page even though no posts appear | |
# for the searched group in some pages. | |
def self.search_feed(user, record_id, text, page_size=100) | |
escaped_text = URI.escape(text, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) | |
items = Session.do_get(user, "/chatter/feed-items?q=#{escaped_text}&pageSize=#{page_size}") | |
# filter out items that are not part of the searched group | |
output = [] |
This file contains 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
# helper that takes a feedItem hash and converts it to HTML, including | |
# properly structuring any included message segments like @mentions. | |
def message_segments(msg_segments) | |
# an array of hashes - each hash a segment | |
html = '' | |
msg_segments.each do |segment| | |
html << case segment['type'] | |
when 'Text' | |
segment['text'] |
This file contains 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
{ | |
"instance_url": "https://na12.salesforce.com", | |
"items": [{ | |
"parent": { | |
"name": "John Smith", | |
"title": null, | |
"firstName": "John", | |
"lastName": "Smith", | |
"companyName": "No company locations found", | |
"mySubscription": null, |