Skip to content

Instantly share code, notes, and snippets.

Christian Lück clue

Block or report user

Report or block clue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@clue
clue / gist:ed235ad8d50087d098e4de5fd370b25e
Created Feb 26, 2018 — forked from that0n3guy/gist:9754047
laptop routeprint and ipconfig all
View gist:ed235ad8d50087d098e4de5fd370b25e
C:\Users\lappy>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : lappy-PC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
View git-mv-with-history
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
View gist:347e6a359a7fa9765d2d
<?php
$loop = React\EventLoop\Factory::create();
$logger = new \Zend\Log\Logger();
$writer = new \Zend\Log\Writer\Syslog(array('application' => 'movim'));
$logger->addWriter($writer);
$connector = new Ratchet\Client\Factory($loop);
View gist:11254932
$buffer = '';
$conn->on('data', function($data, $conn) use (&$buffer) {
$buffer .= $data;
// check to see if the buffer contains any line feeds (detect end of line)
while (false !== ($pos = strpos($buffer, PHP_EOL))) {
// get the first line from the buffer (up to the EOL)
$line = substr($buffer, 0, $pos);
// remove the line from the buffer (advance behind the EOL)
You can’t perform that action at this time.