Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
def set_action(self, profile_id, game_id, game_profile, profile_version, type_id):
obj = ProfileGame()
count_obj = self.get_count_filter(game_id, game_profile)
if count_obj == 0:
obj = self.fill_object_common(obj, profile_id)
obj = self.fill_object_custom(obj, profile_id, game_id, game_profile, profile_version, type_id)
self.set_object_filter(obj)
else :
obj = self.get_object_filter(profile_id, game_id)
using System.Collections.Generic;
namespace GoogleAnalyticsTracker
{
public partial class Tracker
{
public void TrackPageView(string pageTitle, string pageUrl)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("AnalyticsVersion", AnalyticsVersion);
@drawcode
drawcode / mysql_drop_index_if_exists.sql
Last active February 29, 2020 19:01
MYSQL Drop Index If Exists
DELIMITER $$
DROP PROCEDURE IF EXISTS drop_index_if_exists $$
CREATE PROCEDURE drop_index_if_exists(in theTable varchar(128), in theIndexName varchar(128) )
BEGIN
IF((SELECT COUNT(*) AS index_exists FROM information_schema.statistics WHERE TABLE_SCHEMA = DATABASE() and table_name =
theTable AND index_name = theIndexName) > 0) THEN
SET @s = CONCAT('DROP INDEX `' , theIndexName , '` ON `' , theTable, '`');
PREPARE stmt FROM @s;
EXECUTE stmt;
@drawcode
drawcode / oracle_check_column_exists.sql
Last active March 23, 2023 08:18
Check if column exists on table in PGSQL
select table_name from user_tab_columns
where table_name = myTable and column_name = myColumn;
public static string GetActualFilePath( string filename ) {
// Prefer our persistent data path
Debug.Log("Checking for " + Application.persistentDataPath + "/" + filename + ".unity3d");
if (File.Exists(Application.persistentDataPath + "/" + filename + ".unity3d")) {
@drawcode
drawcode / mysqldbdump
Created January 21, 2013 20:20
Dump mysql db at command
mysqldump --add-drop-table -h localhost -u username -p dbname > dbname.sql
@drawcode
drawcode / mysql_backup.py
Created January 21, 2013 20:32
MySQL Backup Python
import os, time, sys, zipfile, datetime,calendar
from os import sep
import shutil
# Script Parameters
# Target Directory for final Zip files
target_dir = r'target'
copy_dir = r'copy'
# The name of the sql file (this will be the same for all backups)
file_name = 'databases.sql'
@drawcode
drawcode / WebWindow.cs
Created January 22, 2013 18:11
Unity WebWindow (browser within unity editor window, helpful for tools that require a web view or more beyond basic controls).
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
public class WebWindow : EditorWindow {
static Rect windowRect = new Rect(100,100,800,600);
static BindingFlags fullBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
static StringComparison ignoreCase = StringComparison.CurrentCultureIgnoreCase;
@drawcode
drawcode / django.apache.config
Last active December 11, 2015 12:19
django apache mod_wsgi config
<VirtualHost *:80>
DocumentRoot D:/http/mysite-com
WSGIScriptAlias / D:/http/mysite-com/apache/django.wsgi
ServerName mysite.com
</VirtualHost>
<html>
<head>
<meta name="viewport" content="width=device-width" />
</head>
<body>
<h2><a id="applink1" href="fb://profile/116201417">open facebook with fallback to appstore</a></h2>
<h2><a id="applink2" href="unknown://nowhere">open unknown with fallback to appstore</a></h2>
<p><i>Only works on iPhone!</i></p>