This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$currentCookieParams = session_get_cookie_params(); | |
$rootDomain = '.example.com'; | |
session_set_cookie_params( | |
$currentCookieParams["lifetime"], | |
$currentCookieParams["path"], | |
$rootDomain, | |
$currentCookieParams["secure"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TailRecursion | |
{ | |
public $func; | |
public $acc; | |
public $recursing; | |
public function tail() | |
{ | |
return call_user_func_array($this->func, func_get_args()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
NewerOlder