Skip to content

Instantly share code, notes, and snippets.

View phpmypython's full-sized avatar

William Wilkerson phpmypython

View GitHub Profile
<?php
$currentCookieParams = session_get_cookie_params();
$rootDomain = '.example.com';
session_set_cookie_params(
$currentCookieParams["lifetime"],
$currentCookieParams["path"],
$rootDomain,
$currentCookieParams["secure"],
var gulp = require('gulp'),
scss = require('gulp-sass'),
notify = require('gulp-notify');
autoprefixer = require('gulp-autoprefixer');
minifyCss = require('gulp-minify-css');
gulp.task('styles', function () {
return gulp.src('scss/main.scss') //This is the path to SCSS files that you want to compile.
.pipe(scss())
.pipe(autoprefixer({
public int longestConsecutive(int[] num) {
int res = 0;
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int n : num) {
if (!map.containsKey(n)) {
int left = (map.containsKey(n - 1)) ? map.get(n - 1) : 0;
int right = (map.containsKey(n + 1)) ? map.get(n + 1) : 0;
// sum: length of the sequence n is in
int sum = left + right + 1;
map.put(n, sum);
<?php
class TailRecursion
{
public $func;
public $acc;
public $recursing;
public function tail()
{
return call_user_func_array($this->func, func_get_args());
}
<?php
// Code to register menu locations
AbleCore\Menu::CreateLocation("header_menu","Header Menu");
AbleCore\Menu::CreateLocation("footer_menu","Footer Menu");
// Code to call those menus
$header_menu = new AbleCore\Menu();
@phpmypython
phpmypython / menu.php
Created July 31, 2014 16:40
Menu Class file
<?php
namespace AbleCore;
class Menu{
public static function CreateLocation($location,$description){
$location_t = __($location);
$description_t = __($description);
register_nav_menu($location_t,$description_t);
}