# Surge configuration file
[Host]
# DNS Hijack
conntest.nintendowifi.net = 10.0.0.1
# the IP address which you want to display the bootstrap page.
[Rule]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ~/.osx — http://mths.be/osx | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
curl -L https://get.rvm.io | bash -s stable | |
rvm install 2.0.0 | |
rvm use 2.0.0@global --default | |
# for chinese user, if you have a wonderful speed ignore this part | |
# to have a faster download speed | |
# switch gem source to ruby.taobao.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Region => The United States and Canada | |
Canada => https://s.mzstatic.com/images/flags/-dsi-50/can.png | |
United States => https://s.mzstatic.com/images/flags/-dsi-50/usa.png | |
Region => Europe | |
Albania => https://s.mzstatic.com/images/flags/-dsi-50/alb.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- user.rb 2019-10-08 18:55:14.014163674 +0800 | |
+++ user-patched.rb 2019-10-08 19:04:01.748236038 +0800 | |
@@ -48,7 +48,7 @@ | |
gl_user.block if block_after_save | |
- log.info "(#{provider}) saving user #{auth_hash.email} from login with admin => #{gl_user.admin}, extern_uid => #{auth_hash.uid}" | |
+ log.info "(#{provider}) saving user #{auth_hash.email} from login with admin => #{gl_user.admin}, extern_uid => #{auth_hash.uid}, primary email => #{gl_user.email}, user.external => #{gl_user.external}" | |
gl_user | |
rescue ActiveRecord::RecordInvalid => e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
#DYNAMIC_IP="" | |
set -e | |
# Set the default policies to allow everything while we set up new rules. | |
# Prevents cutting yourself off when running from remote SSH. | |
/sbin/iptables -P INPUT ACCEPT | |
/sbin/iptables -P FORWARD ACCEPT | |
/sbin/iptables -P OUTPUT ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
MAKEJOBS=$(cat /proc/cpuinfo | grep processor | wc -l) | |
# fix PATH priority, better set in .bashrc / .zshrc | |
export PATH=/usr/local/bin:$PATH | |
sudo yum update && \ | |
sudo yum groupinstall -y "Development Tools" && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by ETiV on 10/24/14. | |
*/ | |
var mysql = require('mysql') | |
, config = require('./config'); | |
/** | |
* config = | |
* { | |
mysql: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ idx: 1, | |
title: '上海之恋', | |
abbr: 'shanghaizhilian', | |
artist: '橘子焦糖', | |
offset: '0.098611', | |
bpm: '149', | |
'4k': { ez: 2, nm: 4, hd: 5 }, | |
'5k': { ez: 2, nm: 4, hd: 6 } }, | |
{ idx: 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var find_next_max = function (num) { | |
var _result = '', _arr = num.toString().split(''); | |
// 从 _arr 里找到比 num 首位大的最小的数 | |
// 因为 _arr 里的数字都是个位数, 所以返回 10 的话, 表示找不到 | |
var find_number_larger_than_first_pos = function () { | |
var first, n = 10, _num; | |
for (var i in _arr) { | |
_num = parseInt(_arr[i]); | |
if (i == 0) { |
NewerOlder