« first day (4119 days earlier)      last day (812 days later) » 

12:33 AM
can of worms: opened
;-)
 
The twitters will be outraged im sure
 
 
3 hours later…
3:32 AM
I can do pagination with SQL and PHP, but I wonder how I could find what page a given key/id would fall on. I want to insert a new record, and redirect to the specific page listing the records, which the new record is on.
 
 
3 hours later…
6:53 AM
posted on January 25, 2022

 
 
4 hours later…
10:50 AM
TFW new toy at work, and suddenly it's 5am
 
:P
 
@Tiffany You stayed in the office the whole night? o.O
Your boss must love you :P
 
I have the benefit that our morning standups are at 2pm local time, it helps with the lay-ins after late nights
 
 
5 hours later…
3:36 PM
Hi, I'm using nikic/php-parser And I want to add some nodes at the beginning of the file. Is this possible? The first node in the file can be anything, so I don't really have something to check on. And php-parser says I can only add nodes if the parent structure is an array
 
3:50 PM
ok I just realized I have the stmts array, I can just add there. I don't need a visitor.
 
I don't have conventional stand-ups anymore :D
@IluTov I also don't have conventional working hours, meaning I can work when the positive side of ADHD is pushing me :)
And it can be offset later in the week... in other words, actual flexible hours
 
@Tiffany That makes sense :) For me working too late makes my brain not turn off so I usually avoid it.
 
4:21 PM
hello
 
@IluTov yeah, fell asleep around 5 AM, woke up at about 8AM, can't fall back asleep XD
 
I need convert to ü-> ö->o with iconv,does someone know how to do that
 
Why not just str_replace tho
 
It is unlikely that iconv can do that, reliably.
 
@Girgias this is a challenge and replace method not accepted
@Derick what can I do? can you give some hints :D
 
4:37 PM
@keremayseli but iconv is? I mean you could always reimplement the logic by using an encoding where the umlauts characters only take one byte and then loop over the string
but that's really jank
 
iconv has a //TRANSLIT swtich though
but it does not work reliably
"man iconv" on the command line will tell you how to use it
 
@Crell luckily it is possible to use SplObjectStorage as an enum set 3v4l.org/hqavf
$set = new SplObjectStorage();
enum Foo: int {
    case Bar = 1;
    case Baz = 2;
}
$set[Foo::Bar] = 'bar';
 
php -r 'echo iconv("utf-8", "ascii//TRANSLIT", "öäoü");'
results in:
oaou
 
not so strong typed but at least can be treated as an array
 
Ish, yes.
 
4:39 PM
(if you have the right locales installed)
 
Same for WeakMap.
 
@Crell yes, but the WeakMap has no benefit over SplObjectStorage as you cannot unset enum instance, right ?!
Yes, you cannot.
Unset on SplObjectStorage with enum offset works as expected, so this is my choice for enum set in this case
 
Sure. The RFC noted that already.
 
cmb
4:56 PM
@Derick I think you need libivonc for that; glibc can't do it
 
Facts don't seem to agree:
derick@gargleblaster:~$ ldd `command -v php` | grep iconv
 ⯈ master  𝑷 7.4.27-dev AU DN⁶⁴ 𝑿 3.1.3-dev
derick@gargleblaster:~$ php -r 'echo iconv("utf-8", "ascii//TRANSLIT", "öäoü");'
oaou
I don't have it linked against libiconv
string(5) "glibc"
oaou
 
cmb
might be version or system depending then
 
5:14 PM
or the form wasn't utf8 :-)
 
5:28 PM
I cannot effectively yield from $splObjectStorage cause I do get only enums :(
 
5:43 PM
With a PHP HTTP API that expects JWT token for authorization, is using an iframe viable? I need to avoid PHP HTTP requests to get the text/html response.
Seems I'd need at least some Javascript to fetch the data, and faff with CORS etc. is that about right or is there some magical approach I've not found?
 
5:54 PM
how about XMLHttpRequest, XHR so called Ajax ?? I guess a simple jQuery might be your easiest solution
I'm not a frontend guy so at least this is what I know, I've been doing frontend 10yrs ago
 
yeah that or fetch() as I'm testing with.
client wants to avoid coding their side with HTTP request, iframe is requested. but means no headers to send token stuff, so would be in GET params
 
@Derick w3school php editor is working correct but my local is not working :(. Thanks for helping
 
6:28 PM
As I said... iconv uses locales which aren't very reliable.
 
 
2 hours later…
8:33 PM
o/
 
\o
 
9:14 PM
o/
 
\o/
 
9:29 PM
/o\
 
10:02 PM
            __
         <(o )___
          ( ._> /
           `---'
 
10:50 PM
this is kind of a dumb question but I'm stuck. I'm using Slim\Http for Request objects, there's the "attributes" grab bag that most libraries use, but I want to transform an attribute into something I can use in curl. e.g. if the attribute is say... cat with value of 1234, I should be able to do -H 'Cat: 1234' in a curl request, right?
or am I misunderstanding something?
 
@Tiffany yes. though case in headers is allegedly case-insensitive.
 
thanks
 
If that's "just not working", you could always grab the original request with something like wireshark.org and be able to copy the raw headers.
 
I just glanced at the docs, it's not clear that the attributes array gets populated with headers. But slim has the $request->getHeader[s]() method.
 
there's getAttributes() which is what's being used
turned out I was using the wrong request method, now to figure out the next error message
@Danack firefox has something roughly similar with "copy as curl" in the network tab, but the thing I'm working with, to my knowledge, doesn't have a web interface .... which is probably where wireshark might be helpful
 
11:13 PM
What do you call a small packet scanner that will bite your leg?
Baby wireshark dodododododo baby wireshark dododododo, baby wideshark dodododo baby wireshark.
 
11:25 PM
Get out.
 
I deserved that
 

« first day (4119 days earlier)      last day (812 days later) »