Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
namespace HumanResourcesLib
{
class DelegateCommand : ICommand
{
@codler
codler / gist:4715753
Created February 5, 2013 16:51
Miniräknare, actionscript 2, 2007-03-30
//********************************
// Made by Han Lin Yap
// Copyright Codler
//********************************
stop();
var knapp = new Array();// Kommer att innehålla knapparna.
var m_mall = new Array();// Knappens bakgrund
var knappens_text = new Array(); // Knappens text
/* Start av konfiguering */
@codler
codler / gist:4637138
Last active December 11, 2015 17:48
BombCarrier commands
3d mode:
remove body > div node
set breakpoint at line 80 in game.js, just right after _GAME_.branch_3D and set it to true
run init_game();
run init_core();
run init_scene();
Reduce time left:
fightTime.timeAlive -= 10 * 1000
Fix removed BlobBuilder:
if (window.Blob) { window.BlobBuilder = function() {this.text=""}; window.BlobBuilder.prototype.append = function(t) {this.text+=t}; window.BlobBuilder.prototype.getBlob = function(mt) { return new Blob([this.text], {type:mt}) } }
@codler
codler / gist:3906826
Created October 17, 2012 17:18
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@codler
codler / startpage-text.php
Created October 8, 2012 16:30
Startpage Text Widget Wordpress
<?php
/*
Plugin Name: Startpage Text Widget
Plugin URI: http://yap.nu/
Description: Custom Description Text on startpage
Author: Han Lin Yap
Version: 1 (2012-10-08)
Author URI: http://yap.nu/
*/
@codler
codler / proxy.php
Created May 1, 2012 14:58
Simple PHP Proxy
<?php
/**
* @author Han Lin Yap < http://zencodez.net/ >
* @copyright 2012 zencodez.net
* @license http://creativecommons.org/licenses/by-sa/3.0/
* @package proxy
* @version 1.0 - 2012-05-01
*/
$method = $_SERVER['REQUEST_METHOD'];
$request = substr($_SERVER['PATH_INFO'], 1);
@codler
codler / convert_ascii.php
Created December 20, 2011 09:37 — forked from jaywilliams/convert_ascii.php
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@codler
codler / gist:1481867
Created December 15, 2011 17:01
Glesys API
<?php
$username = 'clXXXXX';
$password = '';
$base_url = 'https://api.glesys.com';
$param = '/server/list/format/json/';
$context = stream_context_create(array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode("$username:$password")
<script>
var queue = 0;
var last_index = 0;
jQuery(function ($) {
$(document).on('click', '#splash .left a', function () {
show_splash(--last_index);
return false;
});
$(document).on('click', '#splash .right a', function () {
@codler
codler / gist:1323293
Created October 28, 2011 19:40 — forked from fat/gist:1217433
tabs with history support
/* ========================================================
* bootstrap-tab.js v2.0.1 modified r1
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*