Skip to content

Instantly share code, notes, and snippets.

View memememomo's full-sized avatar
🏠
Working from home

Uchiko memememomo

🏠
Working from home
  • Aichi, Japan
View GitHub Profile
let keyword = "swift"
let url = NSURL.URLWithString("http://api.atnd.org/events/?format=json&keyword="+keyword)
let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
let task = session.dataTaskWithURL(url, completionHandler: {
(data, response, err) in
var dic = NSJSONSerialization.JSONObjectWithData(data, options:nil, error:nil) as NSDictionary
var events = dic["evants"] as NSArray
println(events)
})
task.resume()
package main
import (
"fmt"
"github.com/dghubble/go-twitter/twitter"
"github.com/dghubble/oauth1"
"log"
"os"
"regexp"
"sort"
@memememomo
memememomo / credentials
Last active August 12, 2018 07:32
DynamoDBlocalでDynamoDBをひとまず触れるようにする ref: https://qiita.com/uchiko/items/b419d512f08279ab0f9c
[dummy]
aws_access_key_id = dummy
aws_secret_access_key = dummy
using System.Linq;
public class Hello{
public static void Main(){
var n = int.Parse(System.Console.ReadLine());
var a = System.Console.ReadLine().Split(' ');
for (var i=n-1; i>=0; i--) {
System.Console.Write(a[i]);
if (i-1 >= 0) {
@memememomo
memememomo / fizzbuzz_spec.rb
Last active October 16, 2016 16:06
RSpecの(describe/context/example/it)の使い分け ref: http://qiita.com/uchiko/items/d34c5d1298934252f58f
describe 'FizzBuzz' do
describe '#run' do
context '3の倍数' do
example 'Fizzという文字列を返すこと' do
expect(FizzBuzz.run(3)).to eq('Fizz')
expect(FizzBuzz.run(6)).to eq('Fizz')
expect(FizzBuzz.run(9)).to eq('Fizz')
expect(FizzBuzz.run(12)).to eq('Fizz')
end
end
# prefixキーをC-tに変更する
set-option -g prefix C-t
# C-bのキーバインドを解除する
unbind C-b
# マウス
set-option -g mouse on
# ウィンドウ履歴の最大行数
@memememomo
memememomo / CachingLoadExample.cs
Last active February 24, 2016 10:17
AssetBundleのサンプルを作成した時のメモ ref: http://qiita.com/uchiko/items/91de62f4cc2d243b479f
using UnityEngine;
using System.Collections;
public class CachingLoadExample : MonoBehaviour
{
string bundleURL = "http://localhost:9000/assets/StreamingAssets/sprites";
string assetName = "Test";
int version = 0;
void Start()
$ git clone git://github.com/tokuhirom/plenv.git ~/.plenv
$ git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/
$ echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(plenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l
@memememomo
memememomo / count.rb
Created December 18, 2013 17:07
misc.rb
file = ARGV[0]
s = File.read(file, :encoding => Encoding::UTF_8)
puts s.length
@memememomo
memememomo / parse_params.pl
Last active December 21, 2015 22:49
inputのnameで配列表記されているものを、Perlのデータ構造に変換する
use strict;
use warnings;
use Data::Dumper;
use Test::More;
sub parse_param {
my ($params) = @_;