Skip to content

Instantly share code, notes, and snippets.

@mogya
mogya / main.css
Last active Aug 29, 2015
Re:どうしてwebデザイナーに・・・CSSが書けないのか?
View main.css
#main li:nth-of-type(3n),
#main li:nth-of-type(5n){
visibility: hidden;
}
#main li:nth-of-type(3n):before,
#main li:nth-of-type(5n):before,
#main li:nth-of-type(15n):before{
visibility: visible;
display: inline;
@mogya
mogya / file0.txt
Last active Aug 29, 2015
spotlightでsleepできるようにする ref: http://qiita.com/mogya/items/8733b5ee1a071e96ae6e
View file0.txt
$ emacs ~/bin/sleep
#!/usr/bin/osascript
tell application "Finder" to sleep
View gist:b2e49120b3f98a0cb8ae
location.href='http://sssslide.com/'+location.href.replace('/mobile/','/')
View oAuthAdapter callback sample
//get timeline
oAuthAdapter.send({
url:'https://api.twitter.com/1/statuses/home_timeline.json',
parameters:[
],
method:'GET',
onSuccess:function(response){
alert('got tweets.see info log.');
response = JSON.parse(response);
for(var i=0;i<response.length;i++){
View how to use oauth_adapter.js
Ti.include('lib/oauth_adapter.js');
var oAuthAdapter = new OAuthAdapter(
'YOUR CONSUMER SECRET',
'YOUR CONSUMER KEY',
'HMAC-SHA1'
);
// load the access token for the service (if previously saved)
oAuthAdapter.loadAccessToken('twitter');
//OAuth if need.
View gist:784373
oAuthAdapter.send({
url:'https://api.twitter.com/1/statuses/update.json',
parameters:[
['status', '@mogya Hay I got working oAuthAdapter! '+Math.random()]
],
method:'POST',
onSuccess:function(responce){
alert('post succeed');
}
});
View 10min twitter client
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title:'10 min twitter client',
tabBarHidden:true,
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
window:win
});
@mogya
mogya / emacs titanium dictionary
Created Feb 4, 2011
emacs titanium dictionary
View emacs titanium dictionary
Titanium
Titanium.addEventListener
Titanium.fireEvent
Titanium.include
Titanium.removeEventListener
Titanium.userAgent
Titanium.version
Titanium.API
Titanium.API.addEventListener
Titanium.API.debug
@mogya
mogya / gist:838562
Created Feb 22, 2011
webview.evalJS cause hang-up on android #titanium?
View gist:838562
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win
});
@mogya
mogya / gist:1056009
Created Jun 30, 2011
A test library for Titanium Mobile
View gist:1056009
var win = Titanium.UI.currentWindow;
var view = Ti.UI.createView();
view.layout = 'vertical';
function addTest(title,action){
var button = Ti.UI.createButton({
title:title,
width:300,
height:30
});
button.addEventListener('click',function(){
You can’t perform that action at this time.