Skip to content

Instantly share code, notes, and snippets.

nvram set local_domain=$(nvram get lan_ipaddr)
nvram commit
@alswl
alswl / hosts
Last active July 13, 2025 10:33
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@aubricus
aubricus / License
Last active November 14, 2024 11:22
Python Progress Bar
Copyright 2020 Aubrey Taylor
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH
@jaymzznoori
jaymzznoori / Example.qml
Last active November 27, 2016 21:59
Example for Sailfish UI programming in QML
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow {
// Chapter 1: Basic primitives
Image {
visible: false
source: "jolla.png"
Behavior on opacity { NumberAnimation {} }
@MattRix
MattRix / UnityEditorIcons.txt
Last active July 13, 2025 07:52
A list of all the built-in EdtiorGUI icons in Unity. Use EditorGUIUtility.IconContent([icon name]) to access them.
ScriptableObject Icon
_Popup
_Help
Clipboard
SocialNetworks.UDNOpen
SocialNetworks.Tweet
SocialNetworks.FacebookShare
SocialNetworks.LinkedInShare
SocialNetworks.UDNLogo
animationvisibilitytoggleoff
@stephanetimmermans
stephanetimmermans / intall-wordpress-debian.sh
Created September 22, 2015 19:16
Install Wordpress on Debian
#http://www.linuxserve.com/2015/05/install-latest-wordpress-version-on.html
su -
apt-get install apache2 mysql-client mysql-server php5 php5-mysql php5-curl php5-gd
mysql -u root -p
CREATE DATABASE wpdatabase;
CREATE USER wpuser@localhost IDENTIFIED BY 'wppass';
GRANT ALL PRIVILEGES ON wpdatabase.* TO wpuser@localhost;
FLUSH PRIVILEGES;
exit
@tjefferson
tjefferson / browser-detection.js
Last active April 27, 2022 06:13
get more precise Chinese browser information in google analytics
<script>
var browserName = "Other";
var ua = window.navigator.userAgent;
browserRegExp = {
Sogou : /SE\s2\.X|SogouMobileBrowser/,
Explorer2345 : /2345Explorer|2345chrome|Mb2345Browser/,
Liebao : /LBBROWSER/,
Wechat : /MicroMessenger/,
QQBrowser : /QQBrowser/,
Baidu : /BIDUBrowser|baidubrowser|BaiduHD/,
@javiermon
javiermon / instructions.txt
Last active November 15, 2016 00:38
sdcard4jolla
[nemo@Jolla ~]$ devel-su
Password:
[root@Jolla nemo]# cd /etc/systemd/system
[root@Jolla system]# nano mount-sd4android.service
[root@Jolla system]#
[root@Jolla system]# nano /usr/local/sbin/mount-sd4android.sh
[root@Jolla system]# chmod ug+x /usr/local/sbin/mount-sd4android.sh
[root@Jolla system]# systemctl enable mount-sd4android.service
ln -s '/etc/systemd/system/mount-sd4android.service' '/etc/systemd/system/graphical.target.wants/mount-sd4android.service'
ln -s '/etc/systemd/system/mount-sd4android.service' '/etc/systemd/system/display.service.wants/mount-sd4android.service'
@tarruda
tarruda / gtk3-pyenv.sh
Created January 9, 2015 06:38
Install pygtk3 in pyenv
#!/bin/bash
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from https://gist.github.com/mehcode/6172694
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1
fi
}
@rje
rje / SelectPrefabsOfType.cs
Last active November 29, 2024 02:58
Small unity utility to find all prefab objects that have a given component on them
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
public class SelectPrefabsOfType : EditorWindow {
[MenuItem("Window/Prefab Finder")]