Skip to content

Instantly share code, notes, and snippets.

View itzmukeshy7's full-sized avatar
🏠
Working from home

Mukesh Yadav itzmukeshy7

🏠
Working from home
View GitHub Profile
@rsoesemann
rsoesemann / HttpMock.cls
Last active June 1, 2021 13:20
apex-http-mock
@IsTest
public class HttpMock implements HttpCalloutMock {
private static final String ANY_URL = null;
private Map<String, Map<String, Object>> responses = new Map<String, Map<String, Object>>();
// PUBLIC
@douglascayers
douglascayers / delete-orphaned-local-branches.sh
Last active September 6, 2023 14:52
Delete local branches that no longer exist on a remote
#!/bin/bash
set -e
# Delete all local branches whose remote branch no longer exists.
git branch -v | grep -E "[0-9a-zA-Z]{7} \[gone\]" | awk '{ print $1 }' | xargs git branch -D $1
# The commmand explained:
#
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links
@abhinavguptas
abhinavguptas / Blogs-To-Follow-OPML.xml
Last active March 21, 2024 08:56
Best Salesforce Developer Blogs to Follow
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Salesforce Blogs to follow</title>
</head>
<body>
<outline text="salesforce" title="salesforce">
<outline type="rss" text="Sundog" title="Sundog" xmlUrl="http://feeds2.feedburner.com/Sunblog" htmlUrl="http://www.sundoginteractive.com/sunblog/"/>
<outline type="rss" text="Secure Salesforce" title="Secure Salesforce" xmlUrl="http://simplyforce.blogspot.com/feeds/posts/default" htmlUrl="http://simplyforce.blogspot.com/"/>
<outline type="rss" text="Andrew Boettcher - Salesforce Technologist" title="Andrew Boettcher - Salesforce Technologist" xmlUrl="http://techman97.wordpress.com/feed/" htmlUrl="http://techman97.wordpress.com"/>
@toshimaru
toshimaru / jquery-scroll-bottom.js
Last active July 21, 2024 00:02
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
function hostReachable() {
// Handle IE and more capable browsers
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" );
var status;
// Open new request as a HEAD to the root hostname with a random param to bust the cache
xhr.open( "HEAD", "//" + window.location.hostname + "/?rand=" + Math.floor((1 + Math.random()) * 0x10000), false );
// Issue request and handle response
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@rodneyrehm
rodneyrehm / datauri.php
Created November 17, 2011 09:12
PHP: datauri.php - convert image to data-uri
#!/opt/local/bin/php
<?php
/*
1) replace the shebang (first line) with the path to your php binary
(probably something like /usr/bin/php)
2) move the file to /usr/local/bin/datauri.php
(this should be in your PATH)
3) chmod ugo+rx /usr/local/bin/datauri.php
(make the script executable for everyone)