Skip to content

Instantly share code, notes, and snippets.

@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 7, 2025 09:26
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active June 30, 2025 17:24
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@mchome
mchome / seedbox.py
Created September 30, 2015 09:27
magnet转torrent,依赖种子库
import hashlib
import base64
hash = "05153F611B337A378F73F0D32D2C16D362D06BA5"
# print type(hash)
# print hash
sa1 = hash[:2]
sa2 = hash[-2:]
@xinshangshangxin
xinshangshangxin / hexo3_speed_up
Last active October 22, 2017 18:58
检测md文件,在没有语言说明符的代码段后面加上 类似`js` 的说明符;(Hexo 3 中的 highlight.js 会试图分析 ``` 中的代码内容可能属于哪种语言,内容越长,分析时间就越长)
var fs = require('fs');
var path = require('path');
var userPath = path.resolve(process.argv[2] || './');
var codeStyle = process.argv[3] || 'js';
explorer(userPath);
function explorer(path) {
fs.stat(path, function(err, stat) {
if (err) {
@ErisDS
ErisDS / moment-timezone-gmt.js
Created March 30, 2015 12:56
Moment Timezone with data just for GMT
//! moment-timezone.js
//! version : 0.3.0
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
(function (root, factory) {
"use strict";
/*global define*/
@cnDelbert
cnDelbert / How to install tcpping on Linux.md
Last active December 23, 2024 21:15
How to install tcpping on Linux

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@yuuichi-fujioka
yuuichi-fujioka / install_start_stop_daemon.sh
Created June 7, 2014 15:11
install start-stop-daemon to centos, fedora, redhat.
#!/bin/bash
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin/
@johnko
johnko / ttc2ttf.py
Created September 4, 2013 21:01
ttc2ttf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer”
#I thought porting it to Python could be both a challenge and useful
from sys import argv, exit, getsizeof
from struct import pack_into, unpack_from
def ceil4(n):
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync