Skip to content

Instantly share code, notes, and snippets.

View bogomil's full-sized avatar

Bogomil Shopov - Бого bogomil

View GitHub Profile

How to send core PHP errors, events and useful data to a javascript error and log recorder and why.

Imagine you have developed a state-of-art website and after 30 days of worry-free time it finally happens:

Your clients visit the website (let’s imagine this one) and see anything but the expected result: a working web app.

The normal reaction is to call you (in the most unpropriate time) and ask you to fix it asap, because he/she is losing money or the world will end in pain just because this service is not working.

I am sure you will spend 5 min convincing him/her that you haven’t done anything wrong and most probably it’s their fault. Then you will spend another 5 min listening to other-side arguments and after that you will start fixing the problem, without even knowing what it is.

// Search bulgarian websites. It is still in development, but is more than usable.
CmdUtils.CreateCommand({
names: ['търси', 'дири', 'намери'],
arguments: [
{role: "object", label: 'дума', nountype: noun_arb_text},
{role: "goal", label: 'източник', nountype: noun_arb_text}
],
homepage: "http://www.bogomil.info/2759/",
@bogomil
bogomil / x.js
Created September 7, 2009 13:00
CmdUtils.CreateCommand({
names: ["smali", "смали"],
arguments: noun_type_url,
description: ("Заменя вашия URL с по-къс, за по-лесно споделяне."),
homepage: "http://www.bogomil.info/",
author: {name: "Bogomil Shopov", email: "shopov.bogomil@gmail.com"},
license: "GPL",
preview: function(pblock, {object: {text}}){
if (!text) {
pblock.innerHTML = this.description;
@bogomil
bogomil / gist:500334
Created July 30, 2010 11:16
How to send an SMS using Twilio SMS REST API
<?php
//get this from twillio website
require "twilio.php";
class Twillio_SMS
{
var $ApiVersion;
var $AccountSid;
var $AuthToken;
var $smsServer;
@bogomil
bogomil / jpbutton.js
Created May 13, 2011 07:12
Mozilla JetPack example - create a button on page
var buttonScript = [
'var butt = document.createElement("button");', //define button element
'var btext = document.createTextNode("Click me");', //define the text
'butt.appendChild(btext);', //attach text to the button
'butt.addEventListener("click", function(){document.bgColor="red"} , false)', //handle onclick event
'document.getElementById("test").appendChild(butt);', //put the button on the page
];
//haha
boolean b;
b = false;
if (b.toString().lenght < 5 ) {
...
}
<?php
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2014 Bogomil Shopov <shopov.bogomil@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Voice Application with TTS</title>
<!-- Meta Info -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

Keybase proof

I hereby claim:

  • I am bogomil on github.
  • I am bogo (https://keybase.io/bogo) on keybase.
  • I have a public key whose fingerprint is A4F4 ED62 303E 45EA 7EF0 71F4 8D00 0379 B73B C182

To claim this, I am signing this object: