Skip to content

Instantly share code, notes, and snippets.

View Mygod's full-sized avatar
👿
Payment is usually required for a response.

Mygod Mygod

👿
Payment is usually required for a response.
View GitHub Profile
@Mygod
Mygod / gist:f4143a78e0b10ab9ac3a
Created August 11, 2014 09:33
PHP + PostgreSQL Lightweighted Caching
<?
$connection_string = '*insert connection string here*';
$cache_id = 123;
$expiration_seconds = 86400;
function generate_a_huge_string() {
sleep(5);
return 'An awesome string has been generated!';
}
@Mygod
Mygod / gist:9823348
Created March 28, 2014 01:45
STL Definitions
#define general_methods(container) \
explicit container ({[size_type n, {const value_type& val = value_type()}, {charT c}]}, \
{const key_compare& comp = key_compare()}, \
const allocator_type& alloc = allocator_type()); \
template <class InputIterator> \
container (InputIterator first, InputIterator last, {const key_compare& comp = key_compare()}, \
const allocator_type& alloc = allocator_type()); \
container (const container& x); \
container& operator= (const container& x); \
@Mygod
Mygod / gist:9599562
Created March 17, 2014 13:53
AC Automaton (C++ implementation)
#include <iostream>
#include <map>
using namespace std;
namespace Mygod
{
class ACAutomaton
{
private:
@Mygod
Mygod / gist:8898722
Created February 9, 2014 13:00
Goomod Downloader
/* Here's the script that I used to fetch ALL the goomods from goofans.com. Enjoy. *
* Copyleft © 2014 Mygod (studio.mygod.tk) */
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Text.RegularExpressions;