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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
[ | |
// Move out of common paired characters () and [] with `Tab` | |
{ | |
"keys": ["tab"], | |
"command": "move", | |
"args": {"by": "characters", "forward": true}, | |
"context": [ | |
{"key": "auto_complete_visible", "operand": false}, | |
// Check if next char matches (followed by anything) | |
{ "key": "following_text", "operator": "regex_match", "operand": "(:?`|\\)|\\]|\\}).*", "match_all": 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
<script> | |
/** | |
* Provides a fake analytics object that sends all calls to the parent window for processing | |
*/ | |
var analytics = (function() { | |
var eventQueue = []; | |
// Send the events to the frame if it's ready. | |
function flush(method, args) { | |
while (eventQueue.length) { |
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
$.ajax({ | |
url: 'MASHAPE-URL', // The URL to the API. You can get this by clicking on "Show CURL example" from an API profile | |
type: 'POST', // The HTTP Method | |
data: {}, // Additional parameters here | |
dataType: 'json', | |
success: function(data) { alert(JSON.stringify(data)); }, | |
error: function(err) { alert(err); }, | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader("X-Mashape-Authorization", "YOUR-MASHAPE-KEY"); // Enter here your Mashape key | |
} |
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
set -o verbose | |
set -o errexit | |
echo '* Create and initialize a repository.' | |
git init gitflow-tutorial | |
cd gitflow-tutorial/ | |
git flow init -d | |
echo '* Develop a Feature' |
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
var app = angular.module("modalFormApp", ['ui.bootstrap']); | |
app.controller("modalAccountFormController", ['$scope', '$modal', '$log', | |
function ($scope, $modal, $log) { | |
$scope.showForm = function () { | |
$scope.message = "Show Form Button Clicked"; | |
console.log($scope.message); | |
var modalInstance = $modal.open({ |
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
/** | |
* A Little example of recursion | |
**/ | |
(function(){ | |
var flatten = function(toFlatten){ | |
var flatArr = [], | |
result, | |
tmp; |
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
function BFS(node){ | |
var list = [node]; | |
var current = list.shift(); | |
while(current){ | |
console.log(current.data); | |
var i = 1; |
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
/** | |
* Depth-first search tree | |
* @param {string} nodeName - Name of the node to find | |
* @param {object} tree - Node example: {name: 'a', children: [nodeA, nodeB, ...]} | |
* @return {object} Returns the node with the given name | |
*/ | |
function depthFirstSearch(nodeName, tree) { | |
if (tree.name === nodeName) { | |
return tree; //Node found | |
} else { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src='jquery.js'></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</p> |
NewerOlder