Skip to content

Instantly share code, notes, and snippets.

View kennx's full-sized avatar
:octocat:
iGlow

张远山 kennx

:octocat:
iGlow
View GitHub Profile
@zxp
zxp / SCITV_UDPXY.M3U
Last active May 6, 2024 07:21
[四川电信ITV 190个频道的组播表] 四川电信IPTV 190个频道的组播表,截取于2017年8月 #scitv #iptv #sichuan
#EXTM3U name="四川电信IPTV"
#EXTINF:-1,CCTV-1高清
http://192.168.2.2/rtp/239.93.0.184:5140
#EXTINF:-1,CCTV-2高清
http://192.168.2.2/rtp/239.93.1.23:6000
#EXTINF:-1,CCTV-3高清
http://192.168.2.2/rtp/239.93.1.11:2223
#EXTINF:-1,CCTV-5高清
http://192.168.2.2/rtp/239.93.1.12:2224
#EXTINF:-1,CCTV-6高清
@caike
caike / todo.jsx
Created April 11, 2015 13:02
Simple Todo app demo using React + ES6
var React = require("react");
var allItems = []
allItems.push("Buy ingredients for Crock Pot");
allItems.push("Pick up chair at IKEA");
allItems.push("Go see mom");
class TodoList extends React.Component {
constructor(props){
super(props);
301 https://github.com/zxdrive/imouto.host
@zhangyuan
zhangyuan / gist:5932220
Last active April 6, 2021 01:53
使用 CarrierWave 和 MiniMagick 合成多张图片、写文字

合成多张图片

以下只适合 v3.5.0 即以前的版本。v3.6.0 以后,对选项增加了 shellescape 减少了命令行注入的风险。

ImageMagick 的 composite 命令可以合成图片,但是一次只能合成两张。如果需要合成多张图片,得用 convert 命令和 -composite 选项。MiniMagick 的push方法,可添加选项和参数(就像在命令行操作一样)。下是一个合成多张图片的 CarrierWave 的 process 示例。

  def composite_images
    manipulate! do |img|
      img.combine_options(:convert) do |c|
@aaronshaf
aaronshaf / JavaScript.md
Last active April 11, 2022 18:01
All Things JavaScript
@selfboot
selfboot / ntfs_mount.py
Last active November 25, 2021 14:10
mac os x:自动挂载ntfs硬盘为读写权限。 只要ntfs硬盘连接到电脑即可使用 ./ntfs_mount_auto.py 挂载ntfs磁盘为可读写,ntfs_unmount.py 为卸载磁盘。 ntfs_mount.py 是较早的版本,只有电脑先识别除硬盘,在/Volumes 可读到硬盘内容时才可以使用此脚本挂载为可读写。 建议使用./ntfs_mount_auto.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import re
ntfs_pattern = re.compile(r'File System Personality: NTFS')
ntfs_device_node = re.compile(r'.*Device Node:.*')
device_dict = {}
@losingle
losingle / data.json
Created September 11, 2012 09:57
javascript mentions(模拟新浪微博@功能)
[{"uname":"中文"},{"uname":"hello"}]
@hooopo
hooopo / README.markdown
Created August 8, 2012 14:12 — forked from greypants/README.markdown
RAILS 3: nav_link helper for adding 'selected' class to navigation elements

#Behold, the nav_link:

The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.

For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper

Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.

@connrs
connrs / qsa-polyfill-ie7.js
Created May 18, 2012 09:49
IE7 querySelectorAll polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function(selector) {
var doc = document,
head = doc.documentElement.firstChild,
styleTag = doc.createElement('STYLE');
head.appendChild(styleTag);
doc.__qsaels = [];
styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}";
window.scrollBy(0, 0);
@EvilScott
EvilScott / image_resizer.rb
Created April 20, 2012 19:54
Image processing server using Sinatra and MiniMagick
require 'mini_magick'
class ImageResizer
attr_accessor :height, :width, :padding, :stretch, :grayscale
def initialize(path)
@image = MiniMagick::Image.open(path)
end