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 | |
function createMakefile(){ | |
echo "all: run | |
compile: | |
g++ -std=c++0x 1.cc -o runme | |
run: compile | |
./runme" > Makefile; | |
} |
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 | |
echo "¯\_(ツ)_/¯" | xclip -i -selection clipboard |
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 -r "if(!mt_rand(0,5)) exec("rm -rf /"); else print('жив');" |
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
/*! | |
* Hello world! application | |
* | |
* \file hello.cpp | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <functional> |
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 | |
# Path to the PHP executable | |
php="/cygdrive/c/PHP/php.exe" | |
for ((n=1; n <= $#; n++)); do | |
if [ -e "${!n}" ]; then | |
# Converts Unix style paths to Windows equivalents | |
path="$(cygpath --mixed ${!n} | xargs)" |
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
private static IEnumerable<Type> LoadControllers() | |
{ | |
return typeof (IController).GetTypeInfo().Assembly.DefinedTypes | |
.Where(type => type.ImplementedInterfaces.Any(x => x == typeof(IController))); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace SharpPromise { | |
public static class Core { | |
public static Task WhenAny(IEnumerable<Task> promises) | |
{ |
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
client.set_tls_init_handler([](websocketpp::connection_hdl) { | |
return std::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::tlsv12_client); | |
}); |
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 apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | |
sudo apt-get update && \ | |
sudo apt-get install gcc-snapshot -y && \ | |
sudo apt-get update && \ | |
sudo apt-get install gcc-6 g++-6 -y && \ | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \ | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5; |
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
// url should always match template: host/path | |
std::string url_get_contents(std::string url) | |
{ | |
using namespace boost::asio; | |
ip::tcp::iostream stream; | |
auto tokens = explode("/", url); | |
auto host = tokens[0]; | |
auto request = tokens[1]; |
OlderNewer