Skip to content

Instantly share code, notes, and snippets.

View Ext.ux.direct.RemotingProvider
/**
* Ext.ux.direct.RemotingProvider
* @app2641
*/
Ext.define('Ext.ux.direct.RemotingProvider', {
extend: 'Ext.direct.RemotingProvider',
onData: function (options, success, response) {
App.Request.splice(App.Request.length - 1, 1);
@app2641
app2641 / 17_activity_fragment.xml
Created Aug 30, 2012
fragment activity sample
View 17_activity_fragment.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activity_container">
</LinearLayout>
View 17_activity_fragment.java
@Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.add(R.id.activity_container, new FragmentSample1());
transaction.commit();
View 17_replace_method.java
public void replaceFragment () {
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
manager.replace(R.id.activity_container, new FragmentSample2());
manager.addToBackStack(null);
manager.commit();
}
View RaspTestCommand.php
<?php
namespace Rasp\Commands;
class Test extends Base\AbstractCommand
{
/**
* コマンドの実行
View HttpStatusForPHPer.php
#! /usr/bin/php
<?php
$StatusCode = array(
"100" => "Continue",
"101" => "Switching Protocols",
"102" => "Processing", # RFC 2518 (WebDAV)
"200" => "OK",
"201" => "Created",
"202" => "Accepted",
@app2641
app2641 / ggrks
Last active Dec 19, 2015
ggrksシェル。 引数に検索語句を入れて実行するとChromeでGoogle検索を行う。 AND検索も可。
View ggrks
#!/bin/bash
if [ $# == 0 ]; then
echo "引数に検索語句を指定してください"
exit 1
fi
q=`echo $@ | sed -e 's/ /+/g'`
open -a Google\ Chrome https://www.google.com/search?q=$q
@app2641
app2641 / file0.js
Created Oct 5, 2013
InfiniteGrid とFiltersFeature の併用バグの対策 ref: http://qiita.com/app2641/items/cc691ecd86c50932f488
View file0.js
Ext.override(Ext.data.Store, {
refetchPage: function(page, options, forceLoad) {
var me = this,
pageSize = me.pageSize || 200,
start = (page - 1) * me.pageSize,
end = start + pageSize;
if (me.getCount() === me.getTotalCount() && !forceLoad) {
return;
}
@app2641
app2641 / gist:7939572
Last active Dec 31, 2015
ChatWorkAPI GoogleAppsScript Sample
View gist:7939572
function getCalendarSchedule () {
var calendar = CalendarApp.getCalendarsByName('予定')[0],
events = calendar.getEventsForDay(new Date()),
schedule = '';
for (var i = 0; i < events.length; i++) {
schedule += events[i].getTitle() + '\n';
}
return schedule;
@app2641
app2641 / Registry.php
Last active Aug 29, 2015
Zend_Regisry もどきのクラス
View Registry.php
<?php
class Registry extends \ArrayObject
{
/**
* @var Registry
**/
private static $instance;