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
template<class _Ty> | |
class MyAllocator | |
: public _Allocator_base<_Ty> | |
{ // generic MyAllocator for objects of class _Ty | |
public: | |
typedef MyAllocator<_Ty> other; | |
typedef _Allocator_base<_Ty> _Mybase; | |
typedef typename _Mybase::value_type value_type; |
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
#include <functional> | |
#include <deque> | |
#include <stdexcept> | |
template<class T = void*> class Chain { | |
public: | |
typedef Chain<T> my_type; | |
typedef std::function< T (my_type &) > callback; | |
typedef std::function< void (my_type &, std::exception &) > fail_callback; |
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
"file_regex": "^(.*?):([0-9]+):?([0-9]+)?:? error:(.*)$" |
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 subprocess | |
def is_python_module_installed(module): | |
command = ['pip', 'list'] | |
p = PO( command, stdin=PIPE, stdout = PIPE, stderr = PIPE) | |
output,err = p.communicate | |
for module in output.decode('utf-8').splitlines(): | |
if module.split(' ')[0] == module: | |
return True |
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
@echo off | |
rmdir /Q /S build | |
echo "Build removed" | |
pushd stub-cpp\src\main\python | |
git co develop | |
git pull | |
python build_env.py debug |
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
private static void ShuffleArray(IList<int> array) | |
{ | |
if (array == null) throw new ArgumentNullException("array"); | |
var r = new Random((int) DateTime.Now.Ticks); | |
for (int i = array.Count-1; i >= 0; --i) | |
{ | |
var index = r.Next(i+1); | |
if (index == i) continue; |
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
#{ "keys": [ "ctrl+alt+v" ], "command": "open_in_browser" }, | |
import sublime, sublime_plugin | |
import webbrowser | |
import os.path | |
import sys | |
class OpenInBrowserCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
filePath = self.view.file_name() | |
fileToOpen = os.path.basename(filePath) |
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 os | |
import shutil | |
import subprocess | |
def generate_project(): | |
command = ['python', 'generate_project.py', 'release'] | |
result = subprocess.call(command) | |
if result == 0: | |
print 'Project generated' | |
return True |
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
# Install package | |
sudo apt install -y ccache | |
# Update symlinks | |
sudo /usr/sbin/update-ccache-symlinks | |
# Prepend ccache into the PATH | |
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc | |
# Source bashrc to test the new PATH |
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[ | |
#ifndef ${1} | |
#define ${1} | |
${2} | |
#endif // ${1} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> |
OlderNewer