Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
First we'll update your local master
branch. Go to your local project and check out the branch you want to merge into (your local master
branch)
$ git checkout master
Fetch the remote, bringing the branches and their commits from the remote repository.
You can use the -p
, --prune
option to delete any remote-tracking references that no longer exist in the remote. Commits to master
will be stored in a local branch, remotes/origin/master
.
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
function imgLoad(url) { | |
'use strict'; | |
// Create new promise with the Promise() constructor; | |
// This has as its argument a function with two parameters, resolve and reject | |
return new Promise(function (resolve, reject) { | |
// Standard XHR to load an image | |
var request = new XMLHttpRequest(); |
Linus Torvalds in an interview talked about the idea of good taste in code or what I like to call elegance. As one might expect from two slides meant to make a point during a talk, he omits a lot of details to keep it short and simple. This post digs into the specifics of his example (deleting an element from a list) and adds another example (inserting an element in a list) including working code.
This is an example of removing an element from a singly-linked list. It's one of the first data structures you learn about when you start learning about computer science and programming. The reason it doesn't show particularly good taste is because we have that condition at the end where we take a different action depending on whether the element we want to remove is at the beginning of the list or somewhere in the middle.
![Bad taste](http://
Assuming there's a /test folder with .txt files in it. Note how the * character is escaped to prevent expansion.
Linux and Cygwin
find /test -name \*.txt -exec sed -i 's/oldValue/newValue/g' {} \;
macOS
In sed the -i option edits files in-place instead of printing to standard output and requires a file extension.
Use "" to overwrite the file in place.
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
var promiseCount = 0; | |
function testPromise() { | |
'use strict'; | |
promiseCount += 1; | |
var thisPromiseCount = promiseCount; |
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
// $http function is implemented in order to follow the standard Adapter pattern | |
function $http(url) { | |
'use strict'; | |
var core = { | |
// Method that performs the ajax request | |
ajax : function (method, url, args) { |
#!/bin/bash | |
sudo su | |
npm cache clean -f | |
# The n package is a Node helper | |
npm install -g n | |
# Instead of using "stable", you could specify a version: | |
# n 4.4.0 | |
n stable |