Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
tonylukasavage / app.tss
Created July 16, 2013 14:49
TSS reset for Alloy/Titanium
'Label[platform=android]': {
color: '#000' // all platforms except Android default to black
}
'Window': {
backgroundColor: '#fff' // white background instead of default transparent
}
'Window[platform=android]': {
modal: false // make android windows all heavyweight
@DaveRandom
DaveRandom / ContentType.php
Last active December 20, 2015 06:59
PHP Content-Type negotiation
<?php
/**
* Represents a MIME content type
*
* @author Chris Wright <github@daverandom.com>
*/
class ContentType
{
/**
@FokkeZB
FokkeZB / alloy.js
Last active August 13, 2016 17:28
Quick #TiAlloy fix for windows being positioned under the status bar on #iOS7
// For iOS7 only, set the window's top to 20 so they start under the status bar.
Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0;
@plentz
plentz / nginx.conf
Last active July 27, 2024 16:11
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@roccolucatallarita
roccolucatallarita / readme.txt
Created April 7, 2014 21:14
Create route in titanium map module
Create a file in your lib folder, like **rootproject**/lib/routes.map.js
load the module in your file and initialize with the data:
var jsonCoordinates = {
'destination': dest.latitude + ',' + dest.longitude,
'origin': origin.latitude + ',' + origin.longitude,
};
var routes = require("routes.map")(jsonCoordinates, mapview);
@rlemon
rlemon / keepaliveso.user.js
Last active August 29, 2015 14:11
SO Chat room KeepAlive Plus
// ==UserScript==
// @name SO Chat room KeepAlive Plus
// @author Robert Lemon
// @version 0.0.3
// @namespace
// @description make rooms not die
// @include http://chat.stackoverflow.com/rooms/*
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.meta.stackexchange.com/rooms/*
// ==/UserScript==
@rlemon
rlemon / autobin.js
Last active August 29, 2015 14:11
auto bin gifs.
// ==UserScript==
// @name SO Chat room gif autobinner
// @author Robert Lemon
// @version 0.0.32
// @namespace
// @description make rooms not suffer gifs
// @include http://chat.stackoverflow.com/rooms/*
// ==/UserScript==
(function(global) {
"use strict";
@joashp
joashp / PushNotifications.php
Last active June 3, 2024 15:38
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@gooh
gooh / responses.js
Created January 12, 2016 13:46
Swordfighting for Might Pirates; requires https://www.npmjs.com/package/hubot-response
[
{
"match": "You fight like a Dairy Farmer!",
"description": "swordfighting for might pirates",
"listener": "hear",
"response": "How appropriate! You fight like a cow!"
},
{
"match": "This is the END for you, you gutter crawling cur!",
"description": "swordfighting for might pirates",
@rlemon
rlemon / bulk-trash.js
Last active July 23, 2017 20:34
Bulk Trash
var btn = $('<button class="button">Bulk Trash</button>'),
room = document.forms[0].elements.room.value;
btn.on('click', function() {
var modal = $('<div><h4>Trash Who?</h4></div>'),
$users = $('#present-users:not(.more)').clone();
modal.append($users).addClass('popup room-popup').css({
bottom: btn.position().top,
left: btn.position().left
}).on('click', function(e) {
if (confirm("Would you like to trash all posts by " + e.target.title)) {