Skip to content

Instantly share code, notes, and snippets.

View shinriyo's full-sized avatar

shinriyo shinriyo

View GitHub Profile
@shinriyo
shinriyo / score.py
Created December 8, 2013 13:38
実際のスコアのコード
# -*- coding:utf-8 -*-
from bottle import route, run
import sys
import hashlib
from datetime import datetime
from pymongo import Connection
from pymongo.errors import ConnectionFailure
secret_key = 'mySecretKey'
@shinriyo
shinriyo / HSController.cs
Created December 8, 2013 13:04
HSController(改) AdventCalender記事用
using UnityEngine;
using System.Collections;
using System.Security.Cryptography;
using System.Text;
public class HSController : MonoBehaviour
{
private string secretKey = "mySecretKey"; // Edit this value and make sure it's the same as the one stored on the server
public string addScoreURL = "http://localhost/unity_test/addscore.php?"; //be sure to add a ? to your url
public string highscoreURL = "http://localhost/unity_test/display.php";
using UnityEngine;
using System.Collections;
using System.Security.Cryptography;
using System.Text;
public class HSController : MonoBehaviour
{
private string secretKey = "mySecretKey"; // Edit this value and make sure it's the same as the one stored on the server
public string addScoreURL = "http://localhost/unity_test/addscore.php?"; //be sure to add a ? to your url
public string highscoreURL = "http://localhost/unity_test/display.php";
import sys
from datetime import datetime
from pymongo import Connection
from pymongo.errors import ConnectionFailure
def main():
try:
c = Connection(host="localhost", port=27017)
except(ConnectionFailure, e):
sys.stderr.write("Could not connect to MongoDB: %s" % e)
import sys
import hashlib
from datetime import datetime
from pymongo import Connection
from pymongo.errors import ConnectionFailure
def main():
try:
c = Connection(host="localhost", port=27017)
except(ConnectionFailure, e):
@shinriyo
shinriyo / CSFileInfo.cs
Last active December 29, 2015 01:59
FileInfo 拡張子なしで名前取得
using System.Collections;
using System.IO;
public static class CSFileInfo
{
public static string GetFileNameWithoutExtension (this FileInfo fileInfo)
{
return System.IO.Path.GetFileNameWithoutExtension (fileInfo.Name);
}
}
@shinriyo
shinriyo / Podfile
Last active December 28, 2015 13:59
Podfileの記載
#added in P190
platform :ios, '5.0'
pod 'DCIntrospect'
pod 'GHUnitIOS'
pod 'BlocksKit'
pod 'Underscore.m'
pod 'AQGridView'
pod 'JASidePanels'
pod 'QuickDialog'
@shinriyo
shinriyo / gist:7511479
Created November 17, 2013 10:00
identiferの処理MagicRecord経由でCore Dataを利用
- (void)awakeFromInsert {
[super awakeFromInsert];
CCFUUIDRef uuid = CCFUUIDCreate(kCFAllocatorFefault);
NSString *uuidStr = (__bridge_transfer NSString *) CFUUIDCreateString(kCFAllocatorFefault, uuid);
CCRelease(uuid);
self.identifer = uuidStr;
}
@shinriyo
shinriyo / CoreData.m
Created November 17, 2013 07:13
Core Dataに複雑なやりとり P195
NSManagedObjectContext *moc self[self managedObjectContext];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *description = [[NSEntityDescription entityForName: @"user" inManagedObjectContext:managedObjectCOntext_] init];
[request setEntiry:descriotion];
NSError *error = nil;
NSArray *list = [moc exexuteFetchRequest:request];
MSManagesObject *requestObject = [list objectAtIndex:0];
before(:each) do
@travel_params = {:title => "タイトル"},
:startdate => "2030-01-01", :enddate => "2013-12-31"
end
describe "#POST create"
describe "without login" do
it "should be redirect to login page"
sign_out :user
post :create