Skip to content

Instantly share code, notes, and snippets.

//...
public function register()
{
$this->app->singleton('command.migrate.fresh', function () {
return new FreshCommand();
});
}
//...
@Cyclize
Cyclize / minecraft-offline-uuid.sql
Created April 24, 2024 07:25 — forked from Wector11211/minecraft-offline-uuid.sql
Generate an offline minecraft UUID v3 based on the case sensitive player name
CREATE OR REPLACE FUNCTION generate_offline_uuid(
username_p VARCHAR(20)
) RETURNS VARCHAR(36) BEGIN
DECLARE uuid_bytes VARCHAR(36);
SELECT MD5(CONCAT('OfflinePlayer:', username_p)) INTO uuid_bytes;
SELECT INSERT(uuid_bytes, 13, 2, HEX(CONV(SUBSTR(uuid_bytes, 13, 2), 16, 10) & 0x0f | 0x30)) INTO uuid_bytes;
SELECT INSERT(uuid_bytes, 17, 2, HEX(CONV(SUBSTR(uuid_bytes, 17, 2), 16, 10) & 0x3f | 0x80)) INTO uuid_bytes;
RETURN (SELECT LCASE(CONCAT_WS('-',
SUBSTR(uuid_bytes, 1, 8),
SUBSTR(uuid_bytes, 9, 4),
@gwen001
gwen001 / ejs.sh
Last active April 24, 2024 07:25
onliner to extract endpoints from JS files of a given host
curl -L -k -s https://www.example.com | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | awk -F '//' '{if(length($2))print "https://"$2}' | sort -fu | xargs -I '%' sh -c "curl -k -s \"%\" | sed \"s/[;}\)>]/\n/g\" | grep -Po \"(['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})|(\.(get|post|ajax|load)\s*\(\s*['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})\"" | awk -F "['\"]" '{print $2}' | sort -fu
# using linkfinder
function ejs() {
URL=$1;
curl -Lks $URL | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | sed -r "s/^src['\"]?[=:]['\"]//g" | awk -v url=$URL '{if(length($1)) if($1 ~/^http/) print $1; else if($1 ~/^\/\//) print "https:"$1; else print url"/"$1}' | sort -fu | xargs -I '%' sh -c "echo \"\n##### %\";wget --no-check-certificate --quiet \"%\"; basename \"%\" | xargs -I \"#\" sh -c 'linkfinder.py -o cli -i #'"
}
# with file download (the new best one):
# but there is a bug if you don't provide a root url
[Interface]
Address = <...>
MTU = 1412
PrivateKey = <...>
DNS = <...>
PostUp = iptables -t nat -A POSTROUTING -o %i -j MASQUERADE; iptables -A FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
PostDown = iptables -t nat -D POSTROUTING -o %i -j MASQUERADE; iptables -D FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -D FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
[Peer]
@rishavpandey43
rishavpandey43 / git-commit-styleguide.md
Last active April 24, 2024 07:24
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

@ozzi-
ozzi- / confluence_export_rewrite.sh
Last active April 24, 2024 07:24
rewrites URLs in confluence xml export zip files and creates sensible named zips
#!/bin/bash
if ! [ -x "$(command -v zip)" ]; then
echo 'Error: zip is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v unzip)" ]; then
echo 'Error: unzip is not installed.' >&2
exit 1
fi
@kev-omniata-com
kev-omniata-com / style.xsl
Created February 18, 2014 01:00
xslt for content.xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/"
xmlns:ri="http://www.atlassian.com/schema/confluence/4/ri/"
xmlns:acxhtml="http://www.atlassian.com/schema/confluence/4/"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xsl ac ri acxhtml">
<!-- Transform Confluence storage format to XHTML -->
@jim60105
jim60105 / twitcasting-css-override.css
Last active April 24, 2024 07:20
改善Twitcasting的垃圾UI介面
/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
header {
display: flex;
justify-content: center;
@JeremyWalters
JeremyWalters / ListGroup.vue
Created June 24, 2020 13:12
Vuetify Dynamic Nested Navigation Drawer (v-navigation-drawer) using vue-composition api
<template>
<v-list-group :prepend-icon="(subGroup) ? null : item.icon" :sub-group="subGroup">
<template v-slot:activator>
<v-list-item-title>{{ item.text }} + {{subGroup}}</v-list-item-title>
</template>
<template v-for="(child, i) in item.children">
<list-group v-if="isGroupItem(child)" :key="i" :item="child" subGroup></list-group>
<list-item v-else :key="i" :text="child.text" :icon="child.icon"></list-item>
</template>
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 24, 2024 07:16
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+