Skip to content

Instantly share code, notes, and snippets.

@pburtchaell
pburtchaell / styles.css
Last active February 12, 2025 08:45
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@matstani
matstani / zf2-subquery-join.php
Last active September 1, 2015 09:11
ZF2 JOIN句に副問い合わせ
<?php
$sm = $this->getServiceLocator();
$adapter = $sm->get('Zend\Db\Adapter\Adapter');
$sql = new \Zend\Db\Sql\Sql($adapter);
$select = $sql->select();
$select->from('album');
//副問い合わせ用selectオブジェクト
$subselect = $sql->select();
$subselect->from('album');
@wsargent
wsargent / docker_cheat.md
Last active February 16, 2026 02:22
Docker cheat sheet
@j3tm0t0
j3tm0t0 / recover_opsworks_sg.sh
Created May 16, 2013 02:24
recover security groups for AWS OpsWorks
#!/bin/sh
# creating security groups
ec2-create-group 'AWS-OpsWorks-Web-Server' -d 'AWS OpsWorks Web server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Default-Server' -d 'AWS OpsWorks Default server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Blank-Server' -d 'AWS OpsWorks blank server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-LB-Server' -d 'AWS OpsWorks load balancer - do not change or delete'
ec2-create-group 'AWS-OpsWorks-PHP-App-Server' -d 'AWS OpsWorks PHP-App server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-DB-Master-Server' -d 'AWS OpsWorks database master server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Memcached-Server' -d 'AWS OpsWorks Memcached server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Monitoring-Master-Server' -d 'AWS OpsWorks Monitoring Ganglia server - do not change or delete'
@mala
mala / gist:5062931
Last active March 18, 2020 15:31
TwitterのOAuthの問題まとめ

どういう問題があったか

説明するのめんどい http://vividcode.hatenablog.com/entry/twitter-oauth-vulnerability

どういう対策がされたか

とりあえず即座に攻撃できるような状態ではなくなっています。

フィッシング?

@mochiz
mochiz / gist:4736183
Last active April 16, 2023 03:56
rbenvとruby-buildでRuby環境を最新に保つ

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
@Shinpeim
Shinpeim / 000.md
Last active November 2, 2024 00:52
プロセスとかスレッドとかプロセス間通信とかについて書く場所

重要

サイズがあまりに大きくなってしまったので、gist ではなくて github 上で管理するようにしました。

https://github.com/Shinpeim/process-book

URL 変わっちゃうの申し訳ないんだけど、一覧性が高くなるのと pull req が受け取れるメリットのほうを取ります。せっかく読みにきてくれたのにひと手間かかっちゃってすみません。

この文書の目的

@sglessard
sglessard / Import-data.php
Created January 25, 2013 15:46
Use raw SQL queries with doctrine2 (from the symfony2 web directory)
<?php
/*
* Import data from old application
* http://docs.doctrine-project.org/en/2.0.x/reference/configuration.html
*/
require '../vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', '../vendor/doctrine/common/lib');
$classLoader->register();
@mah0x211
mah0x211 / bittest.c
Last active August 4, 2017 15:17
値が連続してるビットの数をカウントするのにもっとシンプルなやり方はないもんかなぁ。。<ーあった。
/*
* bittest.c
* Copyright 2013 Masatoshi Teruya All rights reserved.
* twitter: @mah0x211
*/
#include <limits.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@hayajo
hayajo / changelog_en.md
Last active March 18, 2026 16:53
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形