Skip to content

Instantly share code, notes, and snippets.

View uedatakeshi's full-sized avatar
💭
working now

Takeshi Ueda uedatakeshi

💭
working now
View GitHub Profile
if (fopen("http://www.s-ita.net/onreco/deploy", "r")) {
$last_line = system('/bin/sh deploy.sh', $retval);
}
@uedatakeshi
uedatakeshi / gist:4856c087d105b25cc0f4
Created January 31, 2015 07:21
CakePHP3 Json output
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler');
}
public function api()
{
$this->viewClass = 'Json';
<html>
<head>
<link rel="stylesheet" type="text/css" href="markdown.css">
<script src="jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="jquery.markdown.js" type="text/javascript"></script>
</head>
<body>
<div class="markdown-text">
## Sample
@uedatakeshi
uedatakeshi / file0.txt
Created December 10, 2014 04:47
Serverspecのインストールからテスト実行まで ref: http://qiita.com/uedatakeshi/items/322a94d6f5b0a4bdcdb5
cd ~/.ssh/
ssh-keygen -t dsa
@uedatakeshi
uedatakeshi / javascript_resources.md
Created December 21, 2013 02:02 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@uedatakeshi
uedatakeshi / 0_reuse_code.js
Created December 21, 2013 01:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@uedatakeshi
uedatakeshi / gist:1768566
Created February 8, 2012 12:05
duplicate
$data[0]['name'] = "abc";
$data[1]['name'] = "123";
$data[2]['name'] = "abcd";
$data[3]['name'] = "123";
$data[4]['name'] = "ken";
print_r($data);
foreach($data as $k => $v) {
$(document).ready(function() {
$(':submit[name=navi]').click(function(){
if ($('select').val() == 0){alert("選択してください");return false;}
});
});
$(document).ready(function() {
$('#allType').click(function(){
$(':checkbox[name^=type]').each(function(){
$(this).attr("checked", "checked");
});
});
});
@uedatakeshi
uedatakeshi / div to table replace
Created May 8, 2009 02:07
div to table replace
$(document).ready(function() {
$('div.input').each(function(){
var line = $(this).html();
line = line.replace(/label>/i, 'label></th><td>');
$(this).replaceWith('<tr><th>' + line +'</td></tr>');
});
$('tr').wrapAll(document.createElement("table"));