Skip to content

Instantly share code, notes, and snippets.

@jeremyhaile
jeremyhaile / Android Haml
Created April 7, 2011 15:08
Example of an android XML file in HAML
!!! XML
- xmlns = {"xmlns:android" => "http://schemas.android.com/apk/res/android"}
- id = "android:id"; width = "android:layout_width"; height = "android_layout_height"; text = "android:text"; orientation = "android:orientation"
%LinearLayout{ xmlns, width => "fill_parent", height => "fill_parent", orientation => "vertical" }
%TextView{ id => "@+id/text", width => "wrap_content", height => "wrap_content", text => "Hello, I am a TextView" }
%Button{ id => "@+id/button", width => "wrap_content", height => "wrap_content", text => "Hello, I am a Button" }
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

using UnityEngine;
using System.Collections;
public class MeshPixelTools : MonoBehaviour {
// Use this for initialization
void Start () {
}
@elerch
elerch / NodeFromCSharp.cs
Last active September 9, 2023 13:43
Using C# to host and communicate with node.js This proof of concept launches node.exe as a separate process, redirecting stdin/stdout. It simply calculates 2+2, then sends a process.exit() call after 10 seconds so the (.Net) app can complete (the suppressOut just gets node to output "undefined" instead of the full return value of setTimeout). Da…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@YoungjaeKim
YoungjaeKim / DragAndDrop.cs
Created July 20, 2013 15:21
GameObject Drag and Drop action for Unity3D
using UnityEngine;
using System.Collections;
public class DragAndDrop : MonoBehaviour
{
private bool _mouseState;
public GameObject Target;
public Vector3 screenSpace;
public Vector3 offset;
@scottyab
scottyab / SignatureCheck.java
Last active June 5, 2024 11:36
Simple Android signature check. Please note: This was created in 2013, not actively maintained and may not be compatible with the latest Android versions. It's not particularly difficult for an attacker to decompile an .apk, find this tamper check, replace the APP_SIGNATURE with theirs and rebuild (or use method hooking to return true from `vali…
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
public class TamperCheck {
//we store the hash of the signture for a little more protection
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";
@suvozy
suvozy / Setup.md
Last active December 28, 2022 07:43
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
@cliffano
cliffano / gist:b86e7a6ddf4d1c451e3e
Created June 2, 2014 08:44
app.js dynamic list
The html page:
<div class="app-page" data-page="blah">
<div class="app-topbar">
<div class="app-title">Blah</div>
</div>
<div class="app-content">
<ul id="somelist" class="app-list">
<li class="app-button" data-target="sometarget">Foo</li>
</ul>
@scottyab
scottyab / Installer
Created September 17, 2014 14:55
Tamper checks
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
public class InstallerCheck{
private static final String PLAY_STORE_APP_ID = "com.google.android";
public static boolean verifyInstaller(final Context context) {