Skip to content

Instantly share code, notes, and snippets.

View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View binary_search
View update_iframe.js
$(document).ready(function () {
var oFra = $("#iframe_id");
$("#button3").click(function () {
oFra.attr("scrolling", "yes");
oFra.attr("src", oFra.attr("src"));
});
});
View Controller-Cronjob-mode.php
<?php
//in controller files
public function beforeFilter() {
parent::beforeFilter();
//Cronjob mode, no views needed
$this->render(false);
//$this->autoRender = false;
//$this->layout = null;
View check running on port 80.bat
netstat -o -n -a | findstr 0.0:80
View GetHTML with file_cache.php
<?php
/*
* @author Fedmich
* @version v1.1
* File caching version
*/
function GetHTML($url, $secs = 900) {
$md5 = md5($url);
$file = dirname(__FILE__) . "/cache/page_$md5.tmp";
@fedmich
fedmich / memcache php.ini
Created May 16, 2012
memcached, PHP ini configurations
View memcache php.ini
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
View Keyboard shortcuts.txt
Ctl+Shift+Del on Chrome opens up the "Clear Browsing Data" window
@fedmich
fedmich / image types.php
Created May 11, 2012
Regular Expressions (RegEx)
View image types.php
<?php
if(preg_match( '@.*\.(png|jpeg|jpg|gif|bmp)@i', $url) ){
$img_type = 'image';
}
?>