const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
export default (async function showResults(values) { | |
await sleep(500); // simulate server latency | |
window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`); | |
}); |
I hereby claim:
- I am chirag64 on github.
- I am chirag64 (https://keybase.io/chirag64) on keybase.
- I have a public key ASDseZqOWzHkMOCv3fQ9eN66LeyevtgcnKjaFdDVhnfAIwo
To claim this, I am signing this object:
/* | |
* @description: A code snippet that mimics the popular Select * SQL syntax in force.com's Apex language. | |
*/ | |
// Initialize setup variables | |
String objectName = 'Contact'; // modify as needed | |
String query = 'SELECT'; | |
Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap(); | |
// Grab the fields from the describe method and append them to the queryString one by one. |
javascript:(function(){var r=$(".restaurant-container:not(:has(.closed))");r.css("border","");var o=Math.floor(Math.random()*r.length);r[o].style.border="3px solid red";r[o].scrollIntoView();})(); |
Below is our current practice for using Git (the technology) & Github (the repository) when collaborating on projects. This process assumes that you already have Git installed & configured, and there is an existing project repository on Github with a "development" branch already setup.
If you do not have Git installed, follow these instructions.
This process also assumes that you are using the command line, however most of these tasks can be performed with a desktop client like Github for Mac or Tower.
1.) Open terminal and locate the project directory you wish to use.
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
function GnomeSort(arr) { | |
for (var i = 0; i < (arr.length - 1);) { | |
// Compare next 2 elements, if they are in correct order, go ahead, else swap them and go back one step | |
if (arr[i] <= arr[i + 1]) { | |
i++; | |
} else { | |
var temp = arr[i]; | |
arr[i] = arr[i + 1]; | |
arr[i + 1] = temp; |
// Recursive function to flatten out a multi-dimensional array | |
function FlattenArray(arr) { | |
var newArr = []; | |
for (var i = 0; i < arr.length; i++) { | |
// Go through each elements of array, if element is array, call this function with it as parameter and then concatenate | |
// with the new array, else just add the element to the new array, then return the new array in the end | |
if (Array.isArray(arr[i])) { | |
newArr = newArr.concat(FlattenArray(arr[i])); | |
} | |
else { |