Skip to content

Instantly share code, notes, and snippets.

View onlythinking's full-sized avatar
🏠
Working from home

Xingping Li onlythinking

🏠
Working from home
View GitHub Profile

How To Install FFmpeg on CentOS 7 / RHEL 7

The RPM Fusion repository depends on the EPEL software repository. If the EPEL is not enabled on your system, enable it by typing:

## RHEL 7
subscription-manager repos --enable rhel-*-optional-rpms \
                           --enable rhel-*-extras-rpms \
                           --enable rhel-ha-for-rhel-*-server-rpms
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
## CentOS 7
@onlythinking
onlythinking / iterm2-solarized.md
Created May 7, 2022 09:07 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@onlythinking
onlythinking / introrx.md
Created February 26, 2022 06:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@onlythinking
onlythinking / nginx.conf
Created January 13, 2021 09:44 — forked from weapp/nginx.conf
Return common errors as json in Nginx
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@onlythinking
onlythinking / encryption.java
Created June 2, 2020 06:13 — forked from itarato/encryption.java
Java AES CBC encryption example
package com.company;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class Main {
Intent intent = new Intent(Intent.ACTION_VIEW);
ComponentName cn = new ComponentName("com.tencent.mm", "com.tencent.mm.plugin.base.stub.WXCustomSchemeEntryActivity");
intent.setData(Uri.parse("weixin://dl/moments"));
intent.setFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
intent.setComponent(cn);
startActivity(intent);
@onlythinking
onlythinking / cors-nginx.conf
Created March 7, 2019 09:08 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@onlythinking
onlythinking / git-tag-delete-local-and-remote.sh
Created June 26, 2018 02:16 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
/** This class implements some features that should be tested. */
@Injectable()
export class HttpClientFeatureService {
constructor(
private http: HttpClient
@onlythinking
onlythinking / page.html
Created April 17, 2018 09:56 — forked from daocren/page.html
xhtmlrenderer (Flying Saucer) with css3 header/footer
<link href="print.css" rel="stylesheet" type="text/css" media="screen,print"/>
...
<div style="-fs-page-sequence: start; page-break-before: always">
<div style="position: running(current);">
<div id="page-header" class="small">
<span class="align-left">some stuff here</span>
<span class="align-right">some other stuff here</span>
<div class="line">&#160;</div>