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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
cat >/etc/profile.d/git.sh <<'EOF' | |
source /usr/share/git-core/contrib/completion/git-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE=true | |
export GIT_PS1_SHOWUNTRACKEDFILES=true | |
export PS1='\[\033[00;36m\]\u@\h\[\033[00m\]:\[\033[01;34m\] \w\[\033[00m\]$(__git_ps1 " (%s)")\$ ' | |
EOF |
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
# Sane settings for Gnome | |
gsettings set org.gnome.desktop.background show-desktop-icons true | |
gsettings set org.gnome.desktop.interface clock-show-date true | |
gsettings set org.gnome.settings-daemon.plugins.xsettings antialiasing 'grayscale' | |
gsettings set org.gnome.settings-daemon.plugins.xsettings hinting 'slight' | |
gsettings set org.gnome.desktop.interface text-scaling-factor '1.0' | |
gsettings set org.gnome.desktop.interface monospace-font-name "Monospace 10" | |
gsettings set org.gnome.desktop.interface document-font-name 'Sans 10' | |
gsettings set org.gnome.desktop.interface font-name 'Cantarell 10' | |
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita' |
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
<# | |
.Synopsis | |
Loads TeamCity system build properties into the current scope | |
Unless forced, doesn't do anything if not running under TeamCity | |
#> | |
param( | |
$prefix = 'TeamCity.', | |
$file = $env:TEAMCITY_BUILD_PROPERTIES_FILE + ".xml", | |
[switch] $inTeamCity = (![String]::IsNullOrEmpty($env:TEAMCITY_VERSION)) | |
) |
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 | |
# Sublime Text 3 Install (last update: Monday 13 March 2017) | |
# | |
# No need to download this script, just run it on your terminal: | |
# | |
# curl -L git.io/sublimetext | sh | |
# Detect the architecture |
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
Key-Type: 1 | |
Key-Length: 2048 | |
Subkey-Type: 1 | |
Subkey-Length: 2048 | |
Name-Real: Root Superuser | |
Name-Email: [email protected] | |
Expire-Date: 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
app.directive('datepickerLocaldate', ['$parse', function ($parse) { | |
var directive = { | |
restrict: 'A', | |
require: ['ngModel'], | |
link: link | |
}; | |
return directive; | |
function link(scope, element, attr, ctrls) { | |
var ngModelController = ctrls[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
// A demonstration example for http://stackoverflow.com/a/26124494 | |
// It runs a goroutine locked to an OS thread on Windows | |
// then impersonates that thread as another user using its name | |
// and plaintext password, then reverts to the default security | |
// context before detaching from its OS thread. | |
package main | |
import ( | |
"log" | |
"runtime" |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
const concurrency = 3 |
OlderNewer