- Delete the relevant section from the
.gitmodulesfile. - Stage the
.gitmoduleschanges git add.gitmodules - Delete the relevant section from
.git/config. - Run
git rm --cached path_to_submodule(no trailing slash). - Run
rm -rf .git/modules/path_to_submodule - Commit
git commit -m "Removed submodule <name>" - Delete the now untracked submodule files
rm -rf path_to_submodule
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
| VBoxManage modifyhd <uuid> --resize <size in MB> |
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
| If it's an entire DB, then: | |
| $ mysqldump -u [uname] -p[pass] db_name > db_backup.sql | |
| If it's all DBs, then: | |
| $ mysqldump -u [uname] -p[pass] --all-databases > all_db_backup.sql | |
| If it's specific tables within a DB, then: |
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
| $("#name").keyup(function(){ | |
| var Text = $(this).val(); | |
| $("#slug").val(function(){ | |
| return Text | |
| .toLowerCase() | |
| .replace(/[^\w ]+/g,'') | |
| .replace(/ +/g,'-') | |
| ; | |
| }); | |
| }); |
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
| { | |
| "query" : { | |
| "filtered" : { | |
| "filter" : { | |
| "bool" : { | |
| "must" : [ | |
| { "terms" : { | |
| "user_id" : [1, 2, 3,4 ,5] | |
| }}, | |
| { "term": { "post_text" : "aku" }} |
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
| from flask import Flask, jsonify | |
| app = Flask(__name__) | |
| @app.route('/api', methods = ['GET']) | |
| def this_func(): | |
| """This is a function. It does nothing.""" | |
| return jsonify({ 'result': '' }) | |
| @app.route('/api/help', methods = ['GET']) |
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
| # Get current dir | |
| import os | |
| os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
| # or | |
| os.path.dirname(os.path.abspath(__name__)) | |
| # or | |
| os.getcwd() |
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
| // Example httptest using gin framework | |
| package gomir | |
| import ( | |
| "testing" | |
| "net/http/httptest" | |
| "net/http" | |
| "github.com/stretchr/testify/assert" | |
| ) |
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
| # built-in twisted getPage return deferred | |
| # but i want to get response_headers | |
| # this funct MyGetPage return HTTPClientFactory object | |
| # instead of deferred | |
| # so after callback we can get headers | |
| from twisted.internet import reactor | |
| from twisted.python.compat import nativeString | |
| from twisted.web.client import URI, HTTPClientFactory |
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
| string_tipe = ", ".join('"%s"' % i for i in split_tipe) |
OlderNewer