Skip to content

Instantly share code, notes, and snippets.

@pheeque
pheeque / get_contents.php
Created April 4, 2019 17:47
Simple php get url function with curl
function get_contents($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
@pheeque
pheeque / kmp.cpp
Last active December 28, 2018 09:12 — forked from YDrall/kmp.cpp
c++ implementation of kmp string matching algorithm.
#include<iostream>
#include<string>
using namespace std;
int *pre_kmp(string pattern)
{
int size = pattern.size();
int *pie=new int [size];
pie[0] = 0;