This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -e | |
| # Go back to the last commit that we want to form the initial commit (detach HEAD) | |
| branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | |
| tag="tmp-$RANDOM" | |
| git checkout HEAD | |
| # reset the branch pointer to the initial commit, | |
| # but leaving the index and working tree intact. | |
| git reset --soft HEAD~1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git filter-branch --tree-filter 'git ls-files -z | xargs -0 dos2unix' -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| from pysrt import SubRipFile, SubRipItem, SubRipTime | |
| parser = argparse.ArgumentParser(description='Merge 2 srt files.') | |
| parser.add_argument('fin', type=str, nargs=2, | |
| help='input file') | |
| parser.add_argument(dest='fout', type=str, nargs=1, | |
| help='the output file') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Select2 2.1</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta name="description" content="Select2 JQuery Plugin"> | |
| <meta name="author" content="Igor Vaynberg"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module SomeObserver | |
| extend ActiveSupport::Concern | |
| included do | |
| after_create :do_something | |
| end | |
| def do_something | |
| # | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Raven | |
| class Report < Tilt::Template | |
| def prepare | |
| end | |
| def evaluate(context, locals, &block) | |
| if context.logical_path.include?('raven') || context.logical_path.include?('github-integration') | |
| data | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc "convert a latin1 database with utf8 data into proper utf8" | |
| task :convert_to_utf8 => :environment do | |
| puts Time.now | |
| dryrun = ENV['DOIT'] != '1' | |
| conn = ActiveRecord::Base.connection | |
| if dryrun | |
| def conn.run_sql(sql) | |
| puts(sql) | |
| end | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def bar(*args) | |
| attribute(:bar, *args) | |
| end | |
| def attribute(name) | |
| puts name | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if Rails::VERSION::MAJOR >= 4 | |
| if Rails::VERSION::MINOR > 0 | |
| ActiveSupport::Deprecation.warn("This patch is probably not useful anymore. Check if https://github.com/rails/rails/pull/12425 have been released.") | |
| end | |
| class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter | |
| def type_cast(value, column) | |
| case value | |
| when TrueClass |