Skip to content

Instantly share code, notes, and snippets.

@vu2
vu2 / .css
Last active August 4, 2016 21:37
/* Responsive: yes */
/* <system section="theme" selected="6653586347153366095"> */
@import url("http://hatenablog.com/theme/6653586347153366095.css");
/* </system> */
@media (max-width: 767px) {
/* グローバルヘッダを消す */
#globalheader-container {
display: none !important;
}
<script>
$(function(){
var text = "ここに適当な文章を入れて下さい";
$('.entry-content').each(function(){
$(this).children("p").each(function(){
if($(this).find('img').length != 1){
$(this).html(text + "</p><p>" + $(this).html());
return false;
}
});
<script>
$(function(){
var text = "ここに適当な文章を入れて下さい";
$('.entry-content').each(function(){
$(this).children("p").each(function(){
if($(this).find('img').length != 1){
$(this).html($(this).html() + text);
return false;
}
});
@vu2
vu2 / Nginx
Last active January 14, 2016 11:13
# 必要なライブラリ類を導入
$ su-
$ apt-get install -y build-essential vim git-core curl imagemagick libmagickwand-dev libimlib2-dev libgd2-noxpm-dev
$ apt-get install -y libssl-dev libxml2-dev libxslt1-dev python-dev
# スモールライトの導入
$ cd /usr/local/src/
$ git clone https://github.com/cubicdaiya/ngx_small_light.git
$ cd ngx_small_light/
$ ./setup --with-gd --with-imlib2
@vu2
vu2 / .css
Created December 6, 2015 05:10
ul li:before{
content: "\f219";
font-family: FontAwesome;
}
@vu2
vu2 / .html
Created December 6, 2015 04:57
<ul>
<li><i class="fa fa-diamond"></i>リスト1</li>
<li><i class="fa fa-diamond"></i>リスト2</li>
<li><i class="fa fa-diamond"></i>リスト3</li>
<li><i class="fa fa-diamond"></i>リスト4</li>
</ul>
class PhotoUploader < CarrierWave::Uploader::Base
def filename
"#{secure_token}.#{file.extension}" if original_filename.present?
end
protected
def secure_token
var = :"@#{mounted_as}_secure_token"
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
end
@vu2
vu2 / .html
Created November 23, 2015 03:03
<html>
<head>
<style>
#wrapper{
position: relative;
}
#header{
position: absolute;
left: 0px;
top: 0px;
@vu2
vu2 / .html
Created November 23, 2015 02:58
<html>
<body>
<div id="wrapper">
<div id="header"></div>
<div id="container"></div>
</div>
</body>
</html>
@vu2
vu2 / .css
Created November 23, 2015 02:50
#container{
position: absolute;
top: 48px;
bottom: 0;
left: 0px;
width: 100%;
overflow-y: scroll;
}