Skip to content

Instantly share code, notes, and snippets.

View dongyuwei's full-sized avatar
💭
天天听儿歌

dongyuwei dongyuwei

💭
天天听儿歌
View GitHub Profile
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* To use: copy this file to ~/Library/KeyBindings/
* after that any Cocoa applications you launch will inherit these bindings
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
@dongyuwei
dongyuwei / .slate
Last active August 29, 2015 13:59 — forked from hulufei/.slate
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout qwerty
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
/*
* Containing floats in a consistent manner
* By Jonathan Neal and Nicolas Gallagher
*/
/*
* New block formatting context method
* IE 6+, Firefox 2+, Safari 4+, Opera 9+, Chrome
*/

How to remove hide the <select> arrow in Firefox using -moz-appearance:none;

Background

I was experimenting on custom styling the <select> elements of a form I was building. One of the things I tried implementing was truncating the text with an ellipsis in case it extended beyond the <select>'s width. It didn't look consistent through browsers, but I've accidentally discovered something really nice.

The bug

@dongyuwei
dongyuwei / justify.html
Last active December 18, 2015 04:39 — forked from anonymous/index.html
Fluid Grid using text-align: justify
<h1>Fluid Grid using text-align: justify</h1>
<!-- FLUID GRID -->
<ul id="Grid">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2012-03-11
##############################

Template Components

Used to provide structural templates.

Pattern

t-template-name
t-template-name--modifier-name
t-template-name__subcomponent-name--subcomponent-modifier-name
@dongyuwei
dongyuwei / contextMenusInTiDesktop.html
Created March 21, 2012 05:22 — forked from dawsontoth/contextMenusInTiDesktop.html
Context menus in Titanium Desktop, a quick sample.
<html>
<body>
<style type="text/css">
body {
-webkit-user-select: auto !important;
}
</style>
Here is some text.
<br />
<textarea rows="10" cols="70">