Skip to content

Instantly share code, notes, and snippets.

@auycro
auycro / UnixNote.md
Last active January 18, 2017 10:22
Unix Command Note and else
@auycro
auycro / MySQL.md
Last active January 21, 2017 10:58
//FROM http://stackoverflow.com/questions/10796464/transfer-ownership-of-a-file-to-another-user-in-google-apps-script
/**
* Change Owner of a file or folder
* Run this as admin and authorise first in the script editor.
*/
function changeOwner(newOwnerEmail, fileOrFolderId){
var file = DocsList.getFileById(fileOrFolderId);
var oldOwnerEmail = file.getOwner().getEmail();
if (oldOwnerEmail === newOwnerEmail) {
// Created by Gumpanat Keardkeawfa on 11/14/16.
// Copyright © 2016 Auycro. All rights reserved.
using System;
using System.IO;
using System.Text;
namespace FileConvertCommaAsciiToChar
{
class MainClass
@auycro
auycro / SampleConnectAndRunQuery.cs
Last active August 22, 2016 07:37
sample query by c# (no testing)
// Created by Auycro on August 22,16.
// Copyright © 2016 Auycro. All rights reserved.
public class SampleConnectAndRunQuery
{
static string insert_sql = "INSERT INTO {0} VALUE ({1},\"{2}\")";
static bool InsertData(string table, int id, string update_detail){
bool result = true;
try {
@auycro
auycro / .gitignore
Created August 11, 2016 05:03 — forked from skeeto/.gitignore
Rectangle area challenge
rect
@auycro
auycro / GetAccountPlugin.java
Last active July 15, 2016 01:16
Android get user account email (but not work)
import android.accounts.AccountManager;
import android.accounts.Account;
public class GetAccountPlugin {
//CANNOT GET CORRECT PURCHASED USER'S EMAIL
public String GetGoogleAccountEmail(Activity activity){
AccountManager manager = (AccountManager) activity.getSystemService(Context.ACCOUNT_SERVICE);
Account[] accounts = manager.getAccounts();
//Log.d(tag, "GetGoogleAccountEmail-LENGTH " + accounts.length);
String strGmail = "";
@auycro
auycro / CaptureScreenButton.cs
Last active July 14, 2016 07:02
Capture Screen Button Unity
// CaptureScreenButton.cs
// UnityPlugins
//
// Created by Gumpanat Keardkeawfa on July 8,16.
// Copyright © 2016 Auycro. All rights reserved.
// for windows, use [winapi](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646928(v=vs.85).aspx)
using UnityEngine;
#if UNITY_EDITOR
@auycro
auycro / git.sh
Last active July 6, 2016 01:03
git with ssh key
#!/bin/bash
# The MIT License (MIT)
# Copyright (c) 2013 Alvin Abad
# https://alvinabad.wordpress.com/2013/03/23/how-to-specify-an-ssh-key-file-with-the-git-command/
# HOW TO USE::
# git.sh -i ~/.ssh/userkey.pem clone [email protected]:/git/repo.git
if [ $# -eq 0 ]; then
echo "Git wrapper script that can specify an ssh-key file