Skip to content

Instantly share code, notes, and snippets.

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

warriorg warriorg

🏠
Working from home
View GitHub Profile
var jsContext = new IronJS.Hosting.CSharp.Context();
jsContext.ExecuteFile("myDlr.js");
var fun = jsContext.GetFunctionAs<Func<double, double, double>>("cacl");
double a = Double.Parse(this.tbxA.Text);
double b = Double.Parse(this.tbxB.Text);
var result = fun.Invoke(a,b);
this.tbxResult.Text = result.ToString();
//
// CLLocation+Sino.h
//
// Created by i0xbean@gmail.com on 13-4-26.
// 火星坐标系转换扩展
//
// earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
// 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html
#import <CoreLocation/CoreLocation.h>
/*
* Copyright (C) 2013 Square, Inc.
*
* 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
@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end
@warriorg
warriorg / Macros.swift
Last active September 5, 2015 13:39 — forked from xmzio/Macros.swift
My aLog and dLog macros in Swift (to abbreviate NSLog)
//
// Macros.swift
//
// Created by Xavier Muñiz on 6/12/14.
import Foundation
// dLog and aLog macros to abbreviate NSLog.
// Use like this:
@warriorg
warriorg / podforceupdate.sh
Last active September 12, 2015 18:25 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@warriorg
warriorg / build.gradle
Created November 27, 2015 03:20 — forked from khernyo/build.gradle
Gradle Android configuration with .so hack
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
[self.tableView setEditing:NO];
}];
moreAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self.tableView setEditing:NO];
}];
@warriorg
warriorg / mongo-autostart-osx.md
Created June 30, 2016 10:45 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@warriorg
warriorg / tmux-cheatsheet.markdown
Created June 1, 2017 02:29 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname