Friday pint talks with fellow inhouse developers

X:- Hey, we’ve recently launched a cool piece of NDA in our proprietary NDA.
Y:- Sounds great. How did you manage to prototype it?
X:- Well, we took some NDA, with NDA, cuz the first one had some problems with caching, and with some NDA, we got this NDA to work!
Y:- Why did you use this NDA, when NDA we use in the company does NDA better, it’s more NDA, NDA and NDA that this!

Open-source helps people socialize! ūüėČ

SQL reinsert row in the same table

Seems that we have a competitor to “export to csv” sql query that I keep forgetting every time I need to export something in the CSV file.

The second nominee is reinserting the row into the same database but with a new primary key.

# YOURID - source record
# yourtable - target table;

CREATE TEMPORARY TABLE tmp_table SELECT * FROM yourtable WHERE id=YOURID; 
SELECT @new_id:=((SELECT id FROM yourtable ORDER BY id DESC LIMIT 1) + 1); 
UPDATE tmp_table SET id=@new_id WHERE id =YOURID; 
INSERT INTO yourtable SELECT * FROM tmp_table WHERE id=@new_id;

 

Basically, and obviously it’s about me

Recent post from Wynn made me cry, because I’ve realized that I haven’t been updating some of the API documentations for quiet some time!

Whether I’m working on¬†docs,¬†guides, or¬†books, Vim is my jam. In order to curb my use of these weasel words, I added some¬†formatting rules¬†to mydotfiles.

Forked, added. Doc files are sparkling with these parasite words.

500px hits commercial marketplace

On the heels of our 500px Marketplace relaunch, we are hard at work building a brand new commercial licensing marketplace based on the feedback of our 500px Community.

This new marketplace will service commercial licensors of photography from the news, editorial, advertising and various other communities who are interested in licensing work by members of the 500px community.

If you are interested in commercially licensed photography from 500px, join our mailing list to be kept updated on our progress toward launch. Member photographers on 500px are being reached on an individual basis, based on their online portfolio, to participate in our pre-launch program.

Good news for 500px. Really nice user-friendly service, with lots of great photos. ¬†Go and check yourself ūüėČ

Migrating to Fozzy.com: finale

Migration to Fozzy.com was accomplished in few days, taking in account domain transfers and all required procedures.

First impressions – fast, really fast, even though I haven’t tried our free CDN network, just for doing some benchmarking, but overall – everything is tuned and migrated smoothly.

Couple of glitches were found in the Control Panel of Fozzy billing, which I’ve already included in the milestones, and will try to resolve soon.

As for now – massive blogging is coming through, stay tuned! ūüėČ

Ruby Sinatra in less than 999B of code

%w.rack tilt date INT TERM..map{|l|trap(l){$r.stop}rescue require l};$u=Date;$z=($u.new.year + 145).abs;puts "== Almost Sinatra/No Version has taken the stage on #$z for development with backup from Webrick"
$n=Module.new{extend Rack;a,D,S,q=Rack::Builder.new,Object.method(:define_method),/@@ *([^\n]+)\n(((?!@@)[^\n]*\n)*)/m
%w[get post put delete].map{|m|D.(m){|u,&b|a.map(u){run->(e){[200,{"Content-Type"=>"text/html"},[a.instance_eval(&b)]]}}}}
Tilt.mappings.map{|k,v|D.(k){|n,*o|$t||=(h=$u._jisx0301("hash, please");File.read(caller[0][/^[^:]+/]).scan(S){|a,b|h[a]=b};h);v[0].new(*o){n=="#{n}"?n:$t[n.to_s]}.render(a,o[0].try(:[],:locals)||{})}}
%w[set enable disable configure helpers use register].map{|m|D.(m){|*_,&b|b.try :[]}};END{Rack::Handler.get("webrick").run(a,Port:$z){|s|$r=s}}
%w[params session].map{|m|D.(m){q.send m}};a.use Rack::Session::Cookie;a.use Rack::Lock;D.(:before){|&b|a.use Rack::Config,&b};before{|e|q=Rack::Request.new e;q.params.dup.map{|k,v|params[k.to_sym]=v}}}

That’s a wow! That’s what I call a minimal Web Framework. Full description of the code can be found here.

Future of PHP and HHVM buzz

  • Input Processing and sanitize (GET/POST/COOKIE)
  • Session Management
  • Database Access without surprises
  • Syntactic sugar for callbacks
  • Template processing
  • XML, HTML, JSON processing

These are stuff that PHP should already have in some kind of fast internal c code, but it simply fails to deliver. Frameworks fill the gap. If HHVM provides substantial better alternatives and people use HHVM then Frameworks will use these extensions.
Framework code is already filled with edge case handling for different PHP Versions, adding a case for HHVM isn’t a problem.

(c) source

WHMCS: IPv6 issues

I suspect that input filtering is being done on ALL the variables at the moment of initialization now, and that an IPv6 address containing colons `:` is being wiped from the server array. This would explain no IP address being returned back to the client.(c)

It seems that WHMCS has problems using Whitelists/API restrictions. It can’t digest IPv6 addresses. Pity, as IPv6 are next door and hosting industry is quite sensible for this issue.

Some might argue on the fact that IPv6 is not here yet, but the standard of IPv6 addressing has been here for ages, and it’s not that hard to implement one. At least for the future.