Skip to content

Instantly share code, notes, and snippets.

View hSATAC's full-sized avatar
🐈
Cataholic

Ash Wu hSATAC

🐈
Cataholic
View GitHub Profile
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Modify by linuz.ly
package main
import (
"bytes"
"fmt"
"code.google.com/p/go.crypto/ssh"
package main
import (
"fmt"
)
type Node struct {
Value int
}

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.

Security is Hard

Massive Assignment

  • watch for ActiveRecord Relation, like has_many, has_many :through
  • watch for user_roles, `group_users
  • UPDATE action

Admin

diff --git a/gc.c b/gc.c
index ace7a08..07b7521 100644
--- a/gc.c
+++ b/gc.c
@@ -253,6 +253,7 @@ typedef struct rb_objspace {
size_t total_allocated_object_num;
size_t total_freed_object_num;
int gc_stress;
+ int gc_disable_lazy_sweep;

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

#import <Foundation/Foundation.h>
@interface ZBFacebookTestUserManager : NSObject
- (id)initWithAppID:(NSString *)inAppID appSecret:(NSString *)inAppSecret;
- (NSDictionary *)createTestAccountWithName:(NSString *)inUsername error:(NSError **)outError;
- (BOOL)deleteTestAccountWithUserID:(NSString *)inUserID error:(NSError **)outError;
@property (readonly) NSString *appID;
@property (readonly) NSString *appSecret;
import urllib, urllib2, json
class FacebookTestUserManager:
'''
A tool which helps to create and delete test account for
Facebook.
See https://developers.facebook.com/docs/test_users/
'''