This file contains hidden or 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/bash | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." | |
exit | |
fi |
This file contains hidden or 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
[ | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }, | |
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} }, | |
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } } | |
] |
This file contains hidden or 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
sudo mv /from_where_it_is to /opt/firefox_dev/ | |
sudo chown -R $(whoami):$(whoami) /opt/firefox_dev/ | |
gnome-desktop-item-edit ~/.local/share/applications --create-new |
This file contains hidden or 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
php artisan tinker --env=local |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="red_50">#fde0dc</color> | |
<color name="red_100">#f9bdbb</color> | |
<color name="red_200">#f69988</color> | |
<color name="red_300">#f36c60</color> | |
<color name="red_400">#e84e40</color> | |
<color name="red_500">#e51c23</color> | |
<color name="red_600">#dd191d</color> | |
<color name="red_700">#d01716</color> |
This file contains hidden or 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
$('#file').change(function(){ | |
var formData = new FormData(); | |
var current = $(this); | |
formData.append("file", $(this)[0].files[0]); | |
// additional data | |
formData.append("id", "1"); | |
var promise = $.ajax({ | |
url: "url", | |
type: 'post', |
This file contains hidden or 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
class CorsMiddleware extends \Slim\Middleware | |
{ | |
public function call() | |
{ | |
// Get reference to application | |
$app = $this->app; | |
if(!$app->request->isOptions()) { | |
// Run inner middleware and application | |
$this->next->call(); |
This file contains hidden or 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
<html> | |
<head> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css"> | |
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<ul class="images-list list-unstyled"> | |
<li> | |
<span class="header"> |
This file contains hidden or 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
<?php | |
Route::group(array('prefix' => 'api/v1'), function(){ | |
// routing here | |
}); |
This file contains hidden or 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
<?php | |
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist"); | |
// log in at server1.example.com on port 22 | |
if(!($con = ssh2_connect("host", "port"))){ | |
echo "fail: unable to establish connection\n"; | |
} else { | |
// try to authenticate with username root, password secretpassword | |
if(!ssh2_auth_password($con, "username", "password")) { | |
echo "fail: unable to authenticate\n"; |