Skip to content

Instantly share code, notes, and snippets.

View anzfactory's full-sized avatar
:octocat:
Working from home

anz anzfactory

:octocat:
Working from home
View GitHub Profile
@ebaker355
ebaker355 / UIColor+AppleCrayons.h
Created October 8, 2012 15:06
UIColor+AppleCrayons
#import <UIKit/UIKit.h>
@interface UIColor (AppleCrayons)
+ (UIColor *)cantaloupeColor;
+ (UIColor *)honeydewColor;
+ (UIColor *)spindriftColor;
+ (UIColor *)skyColor;
+ (UIColor *)lavenderColor;
+ (UIColor *)carnationColor;
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@sachin-handiekar
sachin-handiekar / Demo.java
Last active October 3, 2019 15:05
Instagram Demo
import java.util.Scanner;
import org.jinstagram.Instagram;
import org.jinstagram.auth.InstagramAuthService;
import org.jinstagram.auth.model.Token;
import org.jinstagram.auth.model.Verifier;
import org.jinstagram.auth.oauth.InstagramService;
import org.jinstagram.entity.users.basicinfo.UserInfo;
public class Demo {
@kobakei
kobakei / MainActivity.java
Created January 13, 2013 19:22
Android:YouTubeの動画URLを取得してMediaPlayerで再生するサンプル
/**
* This code is originally from here:
* http://stackoverflow.com/questions/7203047/code-for-download-video-from-youtube-on-java-android
*
* And some code about HTTP header is from here:
* http://xissy.github.com/dev/2012/09/28/get-a-youtube-mp4-file-link-which-can-be-played-iphone/
*/
package com.example.zzz;
import java.io.IOException;
double photoSize = 640;
// フィルターの設定
//// まずフィルターグループを作る。フィルターを一つにまとめることで、あとで画像をつくるときに全部のフィルターがかかった画像が得られる
self.filterGroup = [[GPUImageFilterGroup alloc] init];
//// 最初のフィルター便宜的に
GPUImageFilter *firstFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0, 0.125f, 1.0f, 0.75f)];
[self.filterGroup addFilter:firstFilter];
@mayoff
mayoff / makeAnimatedGif.m
Created February 16, 2013 23:00
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
@cathandnya
cathandnya / gist:5552015
Created May 10, 2013 02:24
multipart posting for Tumblr on Android.
private static void addValue(String val, String key, OutputStream strm, String boundary) throws UnsupportedEncodingException, IOException {
strm.write(boundary.getBytes("UTF-8"));
strm.write("\r\n".getBytes("UTF-8"));
strm.write("Content-Disposition: form-data; name=\"".getBytes("UTF-8"));
strm.write(key.getBytes("UTF-8"));
strm.write("\"\r\n\r\n".getBytes("UTF-8"));
strm.write(val.getBytes("UTF-8"));
strm.write("\r\n".getBytes("UTF-8"));
}
@tc
tc / EncodeAndMuxTest.java
Created September 5, 2013 21:26
OpenGL to video on Android, 4.3 API 18
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@neilsoult
neilsoult / LazyLoad.js
Created October 31, 2013 19:40
LazyLoad directive for loading external javascript for AngularJs. In this example, I use google maps' API as the external library being loaded
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {
{
"status": "success",
"search_nag": {},
"code": 0,
"bookmark": "b28xMDB8MDQ0NWZiOTBjNzNiODlkOTQ1ZTk3ZjY0ZTBhYjU0YjM0ZDYyNDg3NjU3ZWQ3OGJmZjI4ZTliZGRmODBlMzJlNQ==",
"debug_data": {
"query_data": {}
},
"message": "ok",
"data": [