Skip to content

Instantly share code, notes, and snippets.

Ilgrim / getFacebookpageposts.php
Created Jan 4, 2018 — forked from reducedhackers/getFacebookpageposts.php
Getting the most recent posts from a Public Page .
View getFacebookpageposts.php
This may be a long way around a short problem .. but
The PHP SDK from Facebook :
git clone
Im using my own FB App to give me a Token/Secret
Ilgrim / .htaccess
Created Jan 5, 2018 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
Ilgrim / nginx.conf
Created Feb 8, 2018 — forked from chrisallenlane/nginx.conf
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `` and `` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author:
View nginx.conf
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen ssl;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;
Ilgrim / playwav.c
Created Feb 12, 2018 — forked from armornick/playwav.c
Play a sound with SDL2 (no SDL_Mixer)
View playwav.c
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
Ilgrim / main.cpp
Created Feb 12, 2018 — forked from Twinklebear/main.cpp
Example of render to texture with SDL2
View main.cpp
#include <iostream>
#ifdef __linux__
#include <SDL2/SDL.h>
#elif defined(_WIN32)
#include <SDL.h>
const int WIN_WIDTH = 640;
const int WIN_HEIGHT = 480;
Ilgrim / main.cpp
Created Feb 12, 2018 — forked from ruby0x1/main.cpp
SDL2 sample
View main.cpp
//SDL2 flashing random color example
//Should work on iOS/Android/Mac/Windows/Linux
#include <SDL.h>
#include <SDL_opengl.h>
#include <stdlib.h> //rand()
static bool quitting = false;
static float r = 0.0f;
Ilgrim / Dockerfile
Created Feb 14, 2018 — forked from jumanjiman/Dockerfile
exim in a docker container
View Dockerfile
FROM alpine:3.3
RUN echo "" >> /etc/apk/repositories
RUN apk add --no-cache exim
COPY . /
RUN /usr/sbin/
# Volumes must be created AFTER we harden.
View gist:4ebbe45dd55bcdb0d86b484ed4af4332
// world is a 2d array of integers (eg world[10][15] = 0)
// pathStart and pathEnd are arrays like [5,10]
function findPath(world, pathStart, pathEnd)
// shortcuts for speed
var21abs = Math.abs;
var max = Math.max;
var pow = Math.pow;
var sqrt = Math.sqrt;
Ilgrim /
Created Feb 15, 2018 — forked from eevee/
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
Ilgrim / perlin-noise-classical.js
Created Feb 15, 2018 — forked from banksean/perlin-noise-classical.js
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
View perlin-noise-classical.js
// Ported from Stefan Gustavson's java implementation
// Read Stefan's excellent paper for details on how this code works.
// Sean McCullough
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
You can’t perform that action at this time.