Skip to content

Instantly share code, notes, and snippets.

View ArnCarveris's full-sized avatar
🎯
R&D

Arn ArnCarveris

🎯
R&D
View GitHub Profile
@dawsontoth
dawsontoth / app.js
Created February 23, 2011 20:08
Swipe for Android plus Vertical Swipes in @appcelerator #titanium
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
/**
* Adds "swipe" event support to Android, and adds swipe up and down to iOS.
* @param view The view that should be made swipeable.
* @param allowVertical Whether or not vertical swipes (up and down) are allowed; default is false.
* @param tolerance How much further you need to go in a particular direction before swipe is fired; default is 2.
*/
function makeSwipeable(view, allowVertical, tolerance) {
tolerance = tolerance || 2;
@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@JSchaenzle
JSchaenzle / RapidXmlExample.c
Created May 18, 2012 18:37
RapidXml example parsing beer journal
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include "rapidxml-1.13/rapidxml.hpp"
using namespace rapidxml;
using namespace std;
using UnityEngine;
[ExecuteInEditMode]
public class HumanAdaptation : MonoBehaviour
{
21public Shader Shader;
public int InitialSampling = 256;
public float AdaptationCoefficient = 0.01f;
public float Key = 0.5f, White = 0.5f, Limit = 0.02f;
public int LuminanceGridSize = 1;
@rxaviers
rxaviers / gist:7360908
Last active November 18, 2024 10:08
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@twocity
twocity / build.gradle
Created December 17, 2013 08:00
gradle ndk build
/////////////
// NDK Support
//////////////
// If using this, Android studio will fail run the following to set the environment variable for android studio:
// export ANDROID_NDK_HOME=/Android/android-ndk-r8e (Linux)
// launchctl setenv ANDROID_NDK_HOME /Android/android-ndk-r8e (Mac)
// or, better, add the export to the .profile of your user home and re-login
task copyNativeLibs(type: Copy, dependsOn: 'buildNative') {
from(new File('src/main/libs')) { include '**/*.so' }
into new File(buildDir, 'native-libs')
@dlo
dlo / Auto-layout-keyboard-adjustment.md
Last active February 26, 2021 07:33
How to adjust a view's height with Auto Layout when a keyboard appears or disappears in iOS 7.

This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.

Setting Up

The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.

Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.

@Jerdak
Jerdak / CoroutineTracker.cs
Created January 24, 2014 20:48
Incomplete example of how to track Unity coroutines.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Coroutine tracker.
///
/// Custom handler for coroutines that tracks when they start and stop...
/// Uses Singleton class from: http://wiki.unity3d.com/index.php/Singleton
/// </summary>
@liamgriffiths
liamgriffiths / cors.md
Last active August 27, 2024 13:00
How CORS works

Guide to CORS

CORS (cross origin resource sharing) is a mechanism to allow client web applications make HTTP requests to other domains. For example if you load a site from http://domainA.com and want to make a request (via xhr or img src, etc) to http://domainB.com without using CORS your web browser will try to protect you by blocking the response from the other server. This is because browsers restrict responses coming from other domains via the Same-Origin-Policy.

CORS allows the browser to use reponses from other domains. This is done by including a Access-Control headers in the server responses telling the browser that requests it is making is OK and safe to use the response.

Header Description
Access-Control-Allow-Origin: Allow requests from `` to access t
@djromero
djromero / update_provisioning_profile.sh
Last active February 6, 2024 12:13
Download and install a single iOS provisioning profile for Xcode
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile