Skip to content

Instantly share code, notes, and snippets.

@luck-token
luck-token / A8EIME
Last active January 15, 2025 23:10
vDds7U8P3O/7fMeHbUIcVCdDhtbFip8dJJHfwz1o+sPCMM6vYjlxf0EjTqggrYdu7uljDc4VELEW4bTReSLGw6oSO7f9+HIeH7E6CWQP6H9D48KTTamnrGeXL1FP4e3XxdBHqNT9hH9EwybneWqr5saSvJkZfkIKm9Ugm4YuXPvSC1+ecOX5y2VD+izGLYOY8Yu2akbQuvyVIv8IiYHLKCUV/sMHILpMeUd/L9D0axklZK1IbzITFyFVtxvPhkwst3/0xKweBiT0j738iLfhK6+HNIi4syGPlOj3/KzLkitT+H+M3iE4MtWVaNcM2AMrcC8zTuuxCdyC87eOZx2yY3VbMl6VrVef6fmYi5FILpCboZH13h+/NNs/Q1i9p8b03I1jCUI8mWjKy0H3F1N4QLldhVZO7cyetYxK4+NwqlAQlYG5efo1kS58WTcUur/7EJWBuXn6NZEufFk3FLq/++r3o+YMUHrWvjKPmAY7JPm39KaiQCHp6FtRj+WhAzVX/fuzcE3mGID707w9MTYyi9zNDdDLR+1P2bOs7R8eNOYQlYG5efo1kS58WTcUur/7EJWBuXn6NZEufFk3FLq/+00/3k9uWuIlYSEZ/ouojwPKDr4UJAH0USa6oh+QhGoQvQ279YriKE/Vi+F48HKnqy1T9cDSv6dcT4rvxZJDGErIZl6jXGL0lFfJQ5+FINwam9y92HXCdVNDGUxWN5mdYvOlxRg2pqQvQzM9G3faYhxJJPhy2IkWqFBkuBjI3Na6+XvyZ2iqnsmfauimP8jWmCPKS6pD1AueUOBF2Zq/ckwQlYG5efo1kS58WTcUur/7EJWBuXn6NZEufFk3FLq/+0gB6ki+sLNw5VIAmDKG1xFrOPbpHmiZJbgLwapL6oFeYm4AQpGbSOvTJSWjzLqkxsV/B2xtR+QoNZzuMVGhE4xFiQj7Ygpj+BOKrPQZhF8+DJPoCT5MlnQAT4yjpzgtfVYz1+IKWWiO2/jWfLlNW142emy2wQhWDct11KCkljc2
@luck-token
luck-token / check_brower_language.js
Created July 28, 2021 02:22
检查浏览器语言并跳转
function getLanguage() {
let lang = window.navigator.languages ? window.navigator.languages[0] : null;
lang = lang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;
let shortLang = lang;
if (shortLang.indexOf('-') !== -1)
shortLang = shortLang.split('-')[0];
if (shortLang.indexOf('_') !== -1)
shortLang = shortLang.split('_')[0];
@luck-token
luck-token / .gitignore
Created July 17, 2018 07:33
gitignore
/node_modules
/storage/*.key
/vendor
/.idea
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
@luck-token
luck-token / change_pic.py
Created June 21, 2018 03:25
修改图片 hash
#!/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
path = os.path.dirname(os.path.realpath(__file__))
print("Dirname: %s" % path)
for root, dirs, files in os.walk(path):
for file in files:
@luck-token
luck-token / env.php
Created June 12, 2018 09:31
php 配置文件
<?php
if (!function_exists('value')) {
/**
* Return the default value of the given value.
*
* @param mixed $value
* @return mixed
*/
function value($value)
{
@luck-token
luck-token / itunes_transporter_2.136.0.rb
Last active November 20, 2019 08:44
fastlane-itunes_transporter.rb
require 'shellwords'
require 'fileutils'
require 'credentials_manager/account_manager'
require_relative 'features'
require_relative 'helper'
require_relative 'fastlane_pty'
module FastlaneCore
# The TransporterInputError occurs when you passed wrong inputs to the {Deliver::ItunesTransporter}
@luck-token
luck-token / build.sh
Last active November 4, 2024 11:59
RedHat/CentOS 7 : installing and configuring ndpi-netfilter for traffic controlling
uname -r
yum update
yum install kernel-devel
yum groupinstall "Development Tools"
yum install libpcap libpcap-devel iptables-devel git
uname -r
ll /lib/modules/
ll /usr/src/kernels/
@luck-token
luck-token / lnmp.md
Last active March 27, 2018 08:25
lnmp 安装

https://github.com/lj2007331/lnmp

yum -y install wget screen python && wget http://mirrors.linuxeye.com/lnmp-full.tar.gz && tar xzf lnmp-full.tar.gz && cd lnmp && screen -S lnmp
@luck-token
luck-token / replace.md
Created March 27, 2018 05:47
shell 替换
perl -pi -e 's|old_str|new_str|g' example.log