Skip to content

Instantly share code, notes, and snippets.

View flyfy1's full-sized avatar

Song Yangyu flyfy1

View GitHub Profile
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 28, 2024 02:38
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@markerikson
markerikson / appEntryPoint.js
Last active August 1, 2022 07:41
Webpack React/Redux Hot Module Reloading (HMR) example
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");
@flyfy1
flyfy1 / app-models-product_property_decorator.rb
Last active June 6, 2016 10:23
For Solidus: making Property selectable field
Spree::ProductProperty.class_eval do
belongs_to :value_object, class_name: 'Spree::PropertyValue', foreign_key: :value_id
before_validation { self.value = value_object.value if value_id and changes[:value_id] }
end
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@kenjyco
kenjyco / 01-Learning-Python3.md
Last active April 12, 2024 18:47
Learn Python 3 with Jupyter Notebook
@choonkeat
choonkeat / html2sprockets.rake
Last active May 7, 2016 03:35
`html2sprockets:assets` is a quick way to add 3rd-party js/css to your rails app that is asset pipeline compatible; creates local gem in `vendor/gems` and apply them in your `Gemfile`
require 'fileutils'
namespace :html2sprockets do
desc "Setup env for gem creation"
task :env do
@gemname = ENV.fetch('NAME')
@gemdir = File.join(ENV.fetch('GEMDIR', 'vendor/gems'), @gemname)
@asset_dst_path = File.join(@gemdir, ENV.fetch('DST', 'vendor/assets'))
@asset_src_paths = ENV.fetch('SRC').each_line.collect(&:strip)
@chichunchen
chichunchen / .gitignore
Created November 26, 2014 16:51
Git ignore binary files
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
### Above combination will ignore all files without extension ###
@sheharyarn
sheharyarn / api_controller.rb
Last active April 27, 2022 08:53
Render API Errors in Rails
class APIController < ApplicationController
include JSONErrors
# ...
end