Skip to content

Instantly share code, notes, and snippets.

Avatar

Yanming Deng cisolarix

View GitHub Profile
@cisolarix
cisolarix / subtitle-overlap-fixer.go
Created Apr 12, 2020 — forked from nimatrueway/subtitle-overlap-fixer.go
Little tool to fix overlapping subtitles (especially the ones extracted from english auto-subtitles of youtube, vtt files that you would convert to srt with ffmpeg)
View subtitle-overlap-fixer.go
package main
import (
"time"
"regexp"
"bufio"
"strconv"
"fmt"
"os"
"errors"
@cisolarix
cisolarix / mysql2-mojave.md
Created Apr 24, 2019 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave
View mysql2-mojave.md

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@cisolarix
cisolarix / dabblet.css
Created Nov 5, 2018
Vertical centering - Viewport unit method
View dabblet.css
/**
* Vertical centering - Viewport unit method
*/
main {
width: 18em;
padding: 1em 1.5em;
margin: 50vh auto 0;
transform: translateY(-50%);
box-sizing: border-box;
@cisolarix
cisolarix / config.rb
Created Aug 3, 2017 — forked from guiman/config.rb
Example mina deploy script using docker
View config.rb
require 'mina/git'
require 'mina/nginx'
set :application, 'your_app_name'
set :domain, 'your_server'
set :user, 'ubuntu'
set :deploy_to, '/location/to/deploy'
set :app_path, "#{deploy_to}/#{current_path}"
set :repository, 'your_repo'
set :branch, 'master'
@cisolarix
cisolarix / Readme.md
Created Jul 28, 2017 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom
View Readme.md

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
View live reload.md

bundle exec guard -P livereload

@cisolarix
cisolarix / xunlei_download_links_grabber.rb
Created May 10, 2015
xunlei_download_links_grabber
View xunlei_download_links_grabber.rb
View 学院(部门)信息.txt
江西经济发展研究院
研究生学院
校办公室
国际学院
档案馆
信息管理学院
资产管理处
外国语学院
马克思主义学院
老干处
View seeds.rb
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
You can’t perform that action at this time.