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
@uedatakeshi
uedatakeshi / insert br every 3 input
Created October 30, 2008 06:16
insert br every 3 input
$(function(){
$('.searchTableTd4').parents('tr').each(function(n){
$('label', $(this)).each(function(n){
if (n % 3 == 2) $(this).append('<br />');
});
});
});
// 画像のsubmitボタンをねつ造して別cgiに同時にsubmitしてデータを飛ばす
$(function(){
var username = $('table:first table:first tr:first td:first font:last')[0].innerHTML;
$('input[name=s_go]').click(function() {
$.get(
'another.cgi?username=' + username, '',
function(data){
$("<input type='hidden' name='submit_x' />").appendTo("form").val(20);
$("<input type='hidden' name='submit_y' />").appendTo("form").val(16);
                            $('form').submit();
@uedatakeshi
uedatakeshi / file upload
Created April 30, 2009 08:27
file upload
<html>
<head>
<script type="text/javascript" src="./jquery.js"></script>
<script type="text/javascript" src="./form.js"></script>
<script type="text/javascript">
var reg = /(\d+)$/i;
$(document).ready(function() {
@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"));
$(document).ready(function() {
$('#allType').click(function(){
$(':checkbox[name^=type]').each(function(){
$(this).attr("checked", "checked");
});
});
});
$(document).ready(function() {
$(':submit[name=navi]').click(function(){
if ($('select').val() == 0){alert("選択してください");return false;}
});
});
@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) {
@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 / 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 / file0.txt
Created December 10, 2014 04:47
Serverspecのインストールからテスト実行まで ref: http://qiita.com/uedatakeshi/items/322a94d6f5b0a4bdcdb5
cd ~/.ssh/
ssh-keygen -t dsa