Skip to content

Instantly share code, notes, and snippets.

View iPaulPro's full-sized avatar

Paul Burke iPaulPro

View GitHub Profile
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@greenlaw110
greenlaw110 / gelin-common-play-modules.yml
Last active December 5, 2023 02:36
Green's common Play modules
# Application dependencies
require:
- com.greenlaw110 -> app-base 2.1.3
- com.greenlaw110 -> play-excel 1.2.3
- com.greenlaw110 -> config 1.2.2
- com.greenlaw110 -> betterlogs 1.2j
- com.greenlaw110 -> aaa 2.1
- com.greenlaw110 -> play-rythm 1.0.1-b3
- com.greenlaw110 -> morphia 1.5.0a
@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active May 1, 2021 10:16
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss
@dan-palmer
dan-palmer / swap-commands.txt
Created July 10, 2012 09:24
Enable Disable OSX Swap etc
# check swap usage
sysctl vm.swapusage
# disable encrypted swap - SNOW LEOPARD
sudo defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -boolean no
# disable encrypted swap - LION
sudo defaults write /Library/Preferences/com.apple.virtualMemory DisableEncryptedSwap -boolean yes
# disable swap
@chrisbanes
chrisbanes / gist:3834527
Created October 4, 2012 15:49
Fail-safe way of getting first visible child
final int listViewTopPadding = mListView.getPaddingTop();
for (int i = 0, z = mListView.getChildCount(); i < z; i++) {
View child = mListView.getChildAt(i);
if (child.getTop() > (listViewTopPadding - child.getHeight()) && child.getTop() <= listViewTopPadding) {
// Bingo, we have our first visible child...
}
}
@gibbs
gibbs / currency_symbols.php
Last active April 3, 2024 10:09
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@romannurik
romannurik / CheatSheet.java
Last active May 16, 2023 13:42
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google 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
@JakeWharton
JakeWharton / README.md
Last active October 13, 2015 14:38
Maven pom for Google Play services
@galex
galex / SherlockMapFragment.java
Created December 27, 2012 21:13
Google Maps v2 + ActionBarSherlock = SherlockMapFragment
package com.actionbarsherlock.app;
import android.app.Activity;
import android.support.v4.app.Watson.OnCreateOptionsMenuListener;
import android.support.v4.app.Watson.OnOptionsItemSelectedListener;
import android.support.v4.app.Watson.OnPrepareOptionsMenuListener;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.internal.view.menu.MenuItemWrapper;
import com.actionbarsherlock.internal.view.menu.MenuWrapper;
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions: