Skip to content

Instantly share code, notes, and snippets.

View Gibgezr's full-sized avatar

Darren Reid Gibgezr

  • NBCC Miramichi
  • Miramichi, N.B. Canada
View GitHub Profile
http://www.netflix.com/browse/genre/***
The *** is where you type a code relating to the category you’re looking for.
For example, 35800 is steamy romantic movies, 11140 is supernatural thrillers and 67879 is Korean TV shows.
Action & Adventure: 1365
Action Comedies: 43040
Action Sci-Fi & Fantasy: 1568
Action Thrillers: 43048
Adult Animation: 11881
//try values for persistance like 0.75 - 0.25
public double OctavePerlin(double x, double y, double z, int octaves, double persistence)
{
double total = 0;
double frequency = 1;
double amplitude = 1;
double maxValue = 0; // Used for normalizing result to 0.0 - 1.0
for(int i=0;i<octaves;i++)
{
@Gibgezr
Gibgezr / gist:eaf714368f090ae075a0
Created June 17, 2015 14:54
Representations of Pi
//accurate to 6 decimal places
355.f/113
//math.h
#define M_PI 3.14159265358979323846
@Gibgezr
Gibgezr / ECS.cpp
Last active August 29, 2015 14:23 — forked from nasser/ECS.cpp
//
// ECS.cpp
// quadc_two
//
// Created by Ramsey Nasser on 4/25/15.
//
//
//////// framework
//lamda sort a vector
#include <algorithm>
std::sort(vect.begin(), vect.end(), [](ObjectType A, ObjectType B) -> bool{ return (A.id < B.id); });
@Gibgezr
Gibgezr / gist:0f403ee93a661bb01bbd
Last active December 24, 2025 11:47
C++ file operation snippets
//C++ copy files
#include <fstream>
std::ifstream src("from.ogv", std::ios::binary);
std::ofstream dst("to.ogv", std::ios::binary | std::ios::trunc);
dst << src.rdbuf();
/*
the one-liner:
std::ofstream(dest) << std::ifstream(src).rdbuf();
@Gibgezr
Gibgezr / MemLeaks
Created June 17, 2014 16:51
How to locate memory leaks
//this code sets up memory leak detection
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define DEBUG_NEW new(_CLIENT_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW
#endif
//the line below turns on memory leak detection in debug mode
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );