Skip to content

Instantly share code, notes, and snippets.

View remino's full-sized avatar

Rem remino

View GitHub Profile
For
* ES5
* ES6
* CoffeeScript
@remino
remino / pre-commit
Created April 12, 2018 04:58 — forked from samhemelryk/pre-commit
A git pre-commit hook example.
#!/bin/bash
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
@remino
remino / wpautop for ruby
Created July 3, 2012 00:44 — forked from goofmint/wpautop for ruby
WordPress's wpautop function port to ruby.
def wpautop(pee, br = true)
return '' if pee.strip == ''
pee = "#{pee}\n" # just to make things a little easier, pad the end
pee = pee.gsub(/<br \/>\s*<br \/>/s, "\n\n")
# pace things out a little
allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
pee = pee.gsub(Regexp.new('(<'+allblocks+'[^>]*>)'), "\n"+'\1')
pee = pee.gsub(Regexp.new('(<\/'+allblocks+'[^>]*>)'), '\1' + "\n\n")
pee = pee.gsub(/\r\n|\r/, "\n") # cross-platform newlines
if pee.include?('<object')
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
_membersMaleCount: 1,
membersCount: 5,
membersMaleCount: Ember.computed('_membersMaleCount', {
get() {
return this.get('_membersMaleCount')
},
@remino
remino / wma2mp3.sh
Last active December 10, 2015 16:58 — forked from anonymous/wma2mp3.sh
Find and convert WMA files into MP3, including audio and metadata, using ffmpeg.
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $(basename $0) directory"
echo
echo "Specify a directory containing wma files to convert into mp3."
exit 1
fi
find "$1" -iname '*.wma' | while read i; do
@remino
remino / .htaccess
Created November 17, 2015 03:07 — forked from MicahChalmer/.htaccess
Scripts to set up Ruby 1.9.3 on a DreamHost shared hosting account via rbenv and ruby-build, and run a Rack app with it via FastCGI.
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@remino
remino / IllustratorSaveAsSVGs.jsx
Created October 3, 2015 03:17 — forked from seltzered/IllustratorSaveAsSVGs.jsx
Quick little script to batch-convert Illustrator .ai's to .svg's, based on Adobe's sample 'save to pdf's' script. Save it to a jsx, and load it under illustrator. Intended for Illustrator CS6.
/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2010 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
@remino
remino / sass_converter.rb
Created April 2, 2012 03:19 — forked from wolfeidau/sass_converter.rb
Sass plugin for Jekyll
module Jekyll
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /sass/i
end