Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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: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 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
namespace HumanResourcesLib
{
class DelegateCommand : ICommand
{
@codler
codler / dabblet.css
Created March 26, 2013 08:27
Loading Spinner in CSS
@keyframes wheel {
to { transform:rotate(360deg); }
}
.circularProgress:before {
content: '';
display: inline-block;
width: 50px;
height: 50px;
background:
linear-gradient(0deg, transparent 49%, white 49%, white 51%, transparent 51%) 0 0px,
@codler
codler / gist:5383971
Created April 14, 2013 19:56
IRC bot, Node.js v0.6, 2011-12-15 Read and write to both irc and file. Two-way communication.
var util = require('util'),
net = require('net');
fs = require('fs');
vm = require('vm');
repl = require('repl');
var socket = new net.Socket();
socket.setNoDelay(true);
socket.setEncoding('ascii');
package com.ab.jersey.dto;
public class AppError {
private String message;
public AppError() { }
public AppError(String message) {
this.message = message;
}
@codler
codler / gist:5862854
Created June 25, 2013 22:00
Sort version
['1.0.zip', '1.1.1.zip', '1.1.zip', '1.2.zip'].sort(function(a, b) { console.log('-');console.log(a);console.log(b); return (a.replace('.zip', '') < b.replace('.zip', '')) ? -1 : (a.replace('.zip', '') > b.replace('.zip', '')) ? 1 : 0 })
http://pastie.org/2054699