Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Happy

hxgdzyuyi

😀
Happy
View GitHub Profile
@josevalim
josevalim / watcher.sh
Last active Apr 22, 2022
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
View watcher.sh
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@xPaw
xPaw / steam_quick_queue.user.js
Last active Mar 26, 2022
This script has been integrated into SteamDB browser extension!
View steam_quick_queue.user.js
// ==UserScript==
// @name Steam Queue Auto Discoverer
// @description Discover the Steam queue three times to get the sale cards
// @version 2.3.0
// @namespace https://gist.github.com/xPaw/73f8ae2031b4e528abf7
// @icon https://store.steampowered.com/favicon.ico
// @match https://store.steampowered.com/explore*
// @grant none
// ==/UserScript==
@linkdesu
linkdesu / Laravel_validation.php
Last active May 2, 2021 — forked from chareice/validation.php
Localization Validation Message For Chineses With Laravel 5
View Laravel_validation.php
<?php
return [
'unique' => ':attribute 已存在',
'accepted' => ':attribute 是被接受的',
'active_url' => ':attribute 必须是一个合法的 URL',
'after' => ':attribute 必须是 :date 之后的一个日期',
'alpha' => ':attribute 必须全部由字母字符构成。',
'alpha_dash' => ':attribute 必须全部由字母、数字、中划线或下划线字符构成',
View gist:3692265
// 支持自定义命名空间
Do.setConfig('namespace', 'Ark');
// 利用 `Do` 自身的 `add` 来定义模块的方法名
Do.add('cookie', { path: 'cookie.js' });
Do.add('ajax', { path: 'ajax.js', requires:['cookie'] });
Do('ajax', function() {
console.info(Ark.ajax); // Using ajax with cookie mod.
});
@dmitry
dmitry / backbone-mixin.js
Created Oct 1, 2011 — forked from wesen/backbone-mixin.js
Merge backbone views (mixin pattern)
View backbone-mixin.js
/**
* ## Merging mixin views in backbone.js ##
*
* really just more a test for tumblr gistr
*/
/**
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer.
**/
function mergeMixin(view, mixin) {
View CSS for <sup> and <sub>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position