Skip to content

Instantly share code, notes, and snippets.

🤔
I may be slow to respond.

安正超 overtrue

🤔
I may be slow to respond.
Block or report user

Report or block overtrue

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
View scopes.txt
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CSS: source.css
@overtrue
overtrue / pkg.youdomain.com.conf
Created Feb 17, 2017
Packagist proxy template for nginx vhost.
View pkg.youdomain.com.conf
proxy_cache_path /tmp/nginx/cache keys_zone=one:200m
loader_threshold=300 loader_files=2000;
server {
listen *:80;
client_max_body_size 100M;
server_name pkg.yourdomain.com; # YOUR HOST
charset utf-8;
location / {
proxy_cache one;
@overtrue
overtrue / surge_main.conf
Created Oct 27, 2015 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
View surge_main.conf
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
[Rule]
View SetLocale.php
<?php
namespace App\Http\Middleware;
use App;
use Closure;
use Illuminate\Http\Response;
class SetLocale
{
@overtrue
overtrue / Model.php
Last active Oct 17, 2017
Model methods
View Model.php
<?php
namespace App\Models;
class Model
{
public static function withoutEvents(Closure $closure)
{
$dispatcher = self::getEventDispatcher();
View file-signatures.txt
JPEG2000 image files,00 00 00 0C 6A 50 20 20,JP2,Picture
3GPP multimedia files,00 00 00 14 66 74 79 70,3GP,Multimedia
MPEG-4 v1,00 00 00 14 66 74 79 70 69 73 6F 6D,MP4,Multimedia
3rd Generation Partnership Project 3GPP,00 00 00 14 66 74 79 70,3GG|3GP|3G2,Multimedia
Windows Disk Image,00 00 00 00 14 00 00 00,TBI,Windows
MPEG-4 video_1,00 00 00 18 66 74 79 70,3GP5|M4V|MP4,Multimedia
MPEG-4 video_2,00 00 00 1C 66 74 79 70,MP4,Multimedia
3GPP2 multimedia files,00 00 00 20 66 74 79 70,3GP,Multimedia
Apple audio and video,00 00 00 20 66 74 79 70 4D 34 41,M4A,Multimedia
3rd Generation Partnership Project 3GPP2,00 00 00 20 66 74 79 70,3GG|3GP|3G2,Multimedia
@overtrue
overtrue / description.sh
Created Jun 1, 2018
Fix omf background color
View description.sh
set fish_pager_color_progress cyan
@overtrue
overtrue / get_scroll_offset.js
Created Jun 18, 2018 — forked from yuktse/get_scroll_offset.js
js 获取页面滚动高度
View get_scroll_offset.js
var scrollTop = window.pageYOffset
|| document.documentElement.scrollTop
|| document.body.scrollTop
|| 0;
var scrollLeft = window.pageXOffset // netscape
|| document.documentElement.scrollLeft
|| document.body.scrollLeft
|| 0;
/*
@overtrue
overtrue / execute.php
Created Jul 23, 2018 — forked from fordnox/execute.php
Execute shell command with timeout and converting stderr to Exception if any
View execute.php
<?php
/**
* @param int $timeout - max process execution time in seconds until it is terminated
**/
function execute($cmd, $stdin = null, $timeout = 600)
{
$this->log->debug("executing: " . $cmd . " ". $stdin);
$cmd = str_replace("\n", "", $cmd);
$cmd = str_replace("\r", "", $cmd);
View Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"atomic_save": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
You can’t perform that action at this time.