Skip to content

Instantly share code, notes, and snippets.

View ngs's full-sized avatar
🎣
Fly Fishing

Atsushi NAGASE ngs

🎣
Fly Fishing
View GitHub Profile
@ktakayama
ktakayama / DenyRakutenNews.user.js
Last active April 7, 2024 04:58
楽天のメルマガチェックを自動解除するGreaseonkeyスクリプト
// ==UserScript==
// @name Deny Rakuten News
// @namespace http://espion.just-size.jp/archives/05/136155838.html
// @description Deny Rakuten News
// @include https://*.step.rakuten.co.jp/*
// @include https://*.travel.rakuten.co.jp/rsv/RsvInput.do*
// @include https://my.rental.rakuten.co.jp/action/my/*
// @include https://delivery.rakuten.co.jp/*?module=Default&action=OrderStep*
// @include https://auction.item.rms.rakuten.co.jp/*
// @include https://my.checkout.rakuten.co.jp/myc/purchase/Confirm
@mnot
mnot / link_header.py
Created October 15, 2009 00:41
link_header.py: HTTP Link header parsing
@miyagawa
miyagawa / gitweb.psgi
Created March 27, 2010 13:54
Running gitweb.cgi on Plack
# 1. Download git and make gitweb/gitweb.cgi (See gitweb/INSTALL how to set gitweb root etc.)
# 2. Copy this file as gitweb/app.psgi
# 3. cd gitweb; plackup
# 4. Access http://localhost:3000/gitweb.cgi
use Plack::Builder;
use Plack::App::WrapCGI;
use Plack::App::File;
builder {
@0xced
0xced / install-iphone-sdk-3.1.3.sh
Created September 13, 2010 18:43
Install iPhone SDK 3.1.3 script
#!/bin/bash -e
# More information at http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html
IPHONE_SDK_DMG="$HOME/Downloads/iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg"
DEVELOPER_DIR="/Developer"
MOUNT_POINT="/Volumes/iPhone SDK"
function cleanup
{
echo ""
ja:
errors:
messages:
not_found: "は見つかりませんでした"
# not_found: "not found"
already_confirmed: "は既に登録済みです"
# already_confirmed: "was already confirmed"
not_locked: "は凍結されていません"
# not_locked: "was not locked"
/**
This code snippet shows how an Android activity can trigger a web based auth using webview and then use
the cookies from there to make subsequent calls to an API (since the api is checking the cookies to detect
sign in)
MyApplication: The root "controller" and the first activity in my app
OAuthLogin: A class that handles the web based login.
It montors the url change and if the user had been redirected to
a "success" page it sends out the cookie string to the root controller
Once the controller has the cookie, it sets those on the service that
<VirtualHost *:80>
ServerName testapp # hosts ファイルに 127.0.0.1 testapp を設定しておく
DocumentRoot "/Users/user/rails/testapp/public"
ErrorLog /Users/user/rails/testapp/log/error.log
CustomLog /Users/user/rails/testapp/log/access.log common
SetEnv GEM_HOME /Users/user/.rvm/gems/ruby-1.8.7-p249 # <-- .rvm 以下の gems フォルダを指定する
SetEnv GEM_PATH /Users/user/.rvm/gems/ruby-1.8.7-p249:/Users/user/.rvm/gems/ruby-1.8.7-p249@global # <-- .rvm 以下の gems フォルダを指定する
RackEnv development # <-- RailsEnv ではない
<Directory "/Users/user/rails/testapp/public">
Order allow,deny
@cho45
cho45 / b.html
Created November 16, 2010 12:23
Full-scale postMessage on Internet Explorer (location.hash version)
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8"/>
<script type="text/javascript" src="/json2.js"></script>
<script type="text/javascript" src="/postMessage.js"></script>
</head>
<body>
http://anotherhost/
@ma11hew28
ma11hew28 / Create Icons.jsx
Created November 23, 2010 03:50
Photoshop Script to Create iPhone Icons from iTunesArtwork
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
//
@mnbi
mnbi / convertDate.m
Created November 23, 2010 18:19
convert a RFC3339 date string into a NSDate object
#import <Foundation/Foundation.h>
// convert a RFC3399 date (& time) into a NSDate object
// NOTE: This function ignores fractions of a second in the RFC3339
// representation.
NSDate *getDateObject(NSString *rfc3339)
{
// Date and Time representation in RFC3399:
// Pattern #1: "YYYY-MM-DDTHH:MM:SSZ"
// 1