Skip to content

Instantly share code, notes, and snippets.

View qwert1x's full-sized avatar
🖥️

Alexey Makarov qwert1x

🖥️
  • Russia, Moscow
View GitHub Profile
@mohitmamoria
mohitmamoria / README.md
Last active April 21, 2025 18:57
Inertia.js Form Helper for Axios/API calls

Inertia.js ships with a fantastic form helper but it falls short when also using API/Axios calls in your project.

Here's a composable, built on top of the Inertia's form helper that hooks into it to replace the API calls with Axios.

To use, just replace useForm with useAPIForm.

const form = useAPIForm({
    title: '',
});
@calebd
calebd / ArrayHelpers.swift
Last active January 29, 2025 06:05
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
require 'socket'
require 'timeout'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
ID = "\x00\x00\x00\x00"
DEFAULTS = {
host: "localhost",
@rianrainey
rianrainey / How to use in_array_r()
Created December 12, 2012 00:34
PHP doesn't make it very easy to recursively look inside a multi-dimensional array. These couple methods make that easier.
$simpsons = array('bart', 'lisa', 'homer');
echo in_array_r("bart", $simpsons) ? 'found' : 'not found';
@scr34m
scr34m / vmware-vsphere-list-vm.php
Created August 27, 2012 16:46
VMWare vSphere List VM's with PHP using webservices
<?php
class soapclientd extends soapclient
{
public $action = false;
public function __construct($wsdl, $options = array())
{
parent::__construct($wsdl, $options);
}
@dskanth
dskanth / chat.html
Created May 8, 2012 11:00
Client file for Private chat using node.js and socket.io
<script src="/socket.io/socket.io.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
var my_username = '';
function send_individual_msg(id)
{
//alert(id);
//alert(my_username);
socket.emit('check_user', my_username, id);
//socket.emit('msg_user', id, my_username, prompt("Type your message:"));
@pklaus
pklaus / ping.py
Created March 5, 2011 09:50
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping