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 | |
# This file is accessible as https://install.direct/go.sh | |
# Original source is located at github.com/v2ray/v2ray-core/release/install-release.sh | |
CUR_VER="" | |
NEW_VER="" | |
ARCH="" | |
VDIS="64" | |
ZIPFILE="/tmp/v2ray/v2ray.zip" |
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 | |
# | |
# Auto install latest kernel for TCP BBR | |
# | |
# System Required: CentOS 6+, Debian7+, Ubuntu12+ | |
# | |
# Copyright (C) 2016-2017 Teddysun <[email protected]> | |
# | |
# URL: https://teddysun.com/489.html | |
# |
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/bash | |
while read repo | |
do curl -X DELETE -H "Authorization: token GITHUB_TOKEN" "https://api.github.com/repos/$repo" | |
done < repos.txt |
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
/* | |
* NOTE: | |
* - The use of browser-specific styles (-moz-, -webkit-) should be avoided. | |
* If used, they may not render correctly for people reading the email in | |
* a different browser than the one from which the email was sent. | |
* - The use of state-dependent styles (like a:hover) don't work because they | |
* don't match at the time the styles are made explicit. (In email, styles | |
* must be explicitly applied to all elements -- stylesheets get stripped.) | |
*/ |
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
# Beautify shortcut | |
'atom-text-editor': | |
'shift-cmd-h': 'atom-beautify:beautify-editor' | |
# Alignment shortcut | |
'.platform-darwin atom-text-editor': | |
'ctrl-cmd-t': 'atom-alignment:alignMultiple' | |
# Will make autocomplete trigger with 'enter' instead of 'tab' | |
'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list': |
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
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { | |
id nc = viewController; | |
id vc = [[nc viewControllers] objectAtIndex:0]; | |
static UIViewController *previousController = nil; | |
if (previousController == viewController) { | |
if ([vc isKindOfClass:[TopicListViewController class]]) { | |
} | |
} |
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
@implementation ViewController | |
- (void)viewDidLoad{ | |
_showCoverImage.contentMode = UIViewContentModeScaleAspectFit; | |
_showCoverImage.image = [self imageWithBlurredImageWithImage:_showCoverImage.image andBlurInsetFromBottom: 200 withBlurRadius:3]; | |
} | |
- (UIImage*)imageWithBlurredImageWithImage:(UIImage*)image andBlurInsetFromBottom:(CGFloat)bottom withBlurRadius:(CGFloat)blurRadius{ | |
UIGraphicsBeginImageContext(image.size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); |
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
palette="./palette.png" | |
filters="fps=30,scale=320:-1:flags=lanczos" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 | |
# palette.png 可以从这里下载: http://ww4.sinaimg.cn/large/76dc7f1bgw1erny806ga9j200g00g0jo.jpg 请改名为 palette.png | |
# fps 越高越流畅, 但体积会越大 | |
# 使用方法, 运行: ./awesomeGif.sh welcome.mov welcome.gif |
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
- (NSString*)removeEmoji:(NSString *)username { | |
__block NSMutableString* temp = [NSMutableString string]; | |
[username enumerateSubstringsInRange:NSMakeRange(0, [username length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock: | |
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { | |
const unichar hs = [substring characterAtIndex: 0]; | |
// surrogate pair | |
if (0xd800 <= hs && hs <= 0xdbff) { |
NewerOlder