Skip to content

Instantly share code, notes, and snippets.

View xarsh's full-sized avatar

Naito Takao xarsh

View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
FROM ubuntu
RUN apt-get update
RUN apt-get install -y git curl build-essential
RUN apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
ENV HOME /root
ENV ANYENV_HOME $HOME/.anyenv
ENV ANYENV_ENV $ANYENV_HOME/envs
RUN git clone https://github.com/riywo/anyenv $ANYENV_HOME
@Vestride
Vestride / encoding-video.md
Last active May 17, 2024 06:55
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@belsrc
belsrc / gist:672b75d1f89a9a5c192c
Last active April 15, 2023 15:13
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@jonstokes
jonstokes / poltergeist.rb
Created July 13, 2014 23:33
Monkey patching poltergeist for use with JRuby 1.7.11
require "capybara"
require "capybara/poltergeist"
require "capybara/poltergeist/utility"
module Capybara::Poltergeist
Client.class_eval do
def start
@pid = Process.spawn(*command.map(&:to_s), pgroup: true)
ObjectSpace.define_finalizer(self, self.class.process_killer(@pid))
end
@gaspanik
gaspanik / rvm2rbenv-setup.markdown
Last active June 7, 2018 23:23
RVMからrbenvに移行した手順まとめ

RVMからrbenvへの移行(OS X 10.8.x)

(注意)既にRVMを使ってRubyがインストール済みなので、OS X標準のRubyではなくHomebrewを使って別バージョンのRubyをインストールするまでのもろもろの準備は省いています。その部分が必要であれば、このあたりの記事の前段が参考になるかもしれません(Rails OS X Developer Guide)。

RVMのアンインストール

まずは、RVMをアンインストールしましょう。

$ rvm implode
@desandro
desandro / bower-logo.md
Last active December 30, 2021 23:11
Bower logo

In addition to awesome docs #228, Bower deserves a proper logo. See below for sketches. I'm curious if you think any of these are worth me putting more effort into.


Take a look at Yeoman right now.

Screen Shot 2013-02-19 at 4 43 10 PM

The other two entities have awesome logos. Bower's got to represent.

@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@derek-watson
derek-watson / tumblr.rb
Created March 12, 2011 18:47
Tumblr to Jekyll migration
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
require 'rubygems'
require 'open-uri'
require 'nokogiri'