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
import imp | |
import importlib | |
import inspect | |
import glob | |
import requests | |
import os | |
def import_from_string(content, module_name, file_name=None): | |
if not file_name: | |
file_name = '{0}.py'.format(module_name) |
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 swap() { mv $1 $1._tmp; mv $2 $1; mv $1._tmp $2; } |
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
[nodes:vars] | |
ansible_python_interpreter = ls /usr/bin/ | grep -E "^python([2-3](.[0-9])?)?$" | head -n 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
try { | |
System.out.println("attempt to shutdown executor"); | |
executor.shutdown(); | |
executor.awaitTermination(5, TimeUnit.SECONDS); | |
} | |
catch (InterruptedException e) { | |
System.err.println("tasks interrupted"); | |
} | |
finally { | |
if (!executor.isTerminated()) { |
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
# System | |
.DS_Store | |
Thumbs.db | |
.Trashes | |
._* | |
Icon | |
.AppleDouble | |
.LSOverride | |
# Editors |
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
scp server:~/remote/somefile.txt . |
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
find . -name "*.txt" -exec grep -il "Word" {} \; | |
// #linux #bash |
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
<snippet> | |
<content><![CDATA[ | |
// ${1/(.)/\u\1/}s Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)/edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
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
mysqldump -u mysqluser -p mysqldatabase | gzip > db_backup.sql.gz | |
// #mysql #bash #terminal |
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
/** | |
* Реализация API, не изменяйте ее | |
* @param {string} url | |
* @param {function} callback | |
*/ | |
function getData(url, callback) { | |
var RESPONSES = { | |
'/countries': [ | |
{name: 'Cameroon', continent: 'Africa'}, | |
{name :'Fiji Islands', continent: 'Oceania'}, |
NewerOlder