Skip to content

Instantly share code, notes, and snippets.

@lyonsun
lyonsun / image-grid-with-flex.css
Last active May 11, 2018 08:50
simple and nice images grid layout using flex only
#photos {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
#photos div {
flex: auto;
width: 150px;
margin: 5px;
@lyonsun
lyonsun / 1 Gist conventions
Last active August 3, 2017 12:19 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 5.0.0.beta3 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.
<<APP>> change this variables
@lyonsun
lyonsun / index.html
Created February 28, 2016 19:35 — forked from anonymous/index.html
Parallax backgrounds with centered content Parallax backgrounds with centered content // source http://jsbin.com/roqiqedipa
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Parallax backgrounds with centered content</title>
<meta name="description" content="Parallax backgrounds with centered content">
<style id="jsbin-css">
/* background setup */
.background {
background-repeat:no-repeat;
@lyonsun
lyonsun / stopmysql.sh
Created December 9, 2015 06:37
shut down mysql from console.
#!/usr/bin/env bash
sudo mysqladmin shutdown --user=*user* --password=*password*
@lyonsun
lyonsun / config.json
Created December 8, 2015 13:04 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#2fa4e7, 6.5%)",
"@brand-success": "#73a839",
@lyonsun
lyonsun / select2_select_all.js
Created October 28, 2015 21:12
add a checkbox input and use this code to select or unselect all.
// credits: http://jsfiddle.net/jeadr/62/
$("#e1").select2();
$("#checkbox").click(function(){
if($("#checkbox").is(':checked') ){
$("#e1 > option").prop("selected","selected");
$("#e1").trigger("change");
}else{
$("#e1 > option").removeAttr("selected");
$("#e1").trigger("change");
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
##############################
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.real &
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
@lyonsun
lyonsun / gitlog.shell
Last active August 29, 2015 14:19
git log compact commit messages.
git log --since=1/11/2011 --until=28/07/2015 --no-merges --format=%cd%n%B --date=local > CHANGELOG.TXT
@lyonsun
lyonsun / movable.css
Created December 24, 2014 08:39
css3 animation.
.movable
{
/*width:60px;
height:40px;*/
background:#FF6560;
/*color:#ffffff;*/
position:relative;
font-weight:bold;
font-size:20px;