Skip to content

Instantly share code, notes, and snippets.

Cydia guy, "saurik": not a pirate!
The pirate guys are smarter than you, have better tools, and are much more bored.
Phds love disassemblers.
Every minute spent on DRM is a minute you don't spend making your game more appealing to paying customers.
IRC client: takes control of your system if you pirate it. Pirates *hate* that. They won't be your friends.
Single "please don't pirate" nag screen, just once -> sales and eventually removed from piracy repos. Neat!
Think about your actual customers, like the top grossing screen. Pirates just aren't your customers.
Ski jump got more blog reviews its first day than purchases. Funny!
Q. Do people crack free apps just to remove ads?
A. Yes, but we try to discourage them. (even cydia has ads) apps should try differentiating among priced versions as well. See Photoshop elements.
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@ledti
ledti / udisks_functions
Created February 22, 2011 01:02
Simplifies mounting and unmounting with udisks2.
#!/usr/bin/env bash
# udisks_functions: https://bbs.archlinux.org/viewtopic.php?id=109307
# last modified: 2012/08/05
# functions: sdm, sdu, mcm, mcu, srm, sru, fdm, and fdu.
# aliases: sd*m, sd*u, mc*m, and mc*u.
# options:
enable_device="true"
enable_mmc="true"
@mattgorecki
mattgorecki / gist:974920
Created May 16, 2011 17:32
web2py mobile browser detection
# Detect mobile device. Set to mobile view if available
from mobile.sniffer.detect import detect_mobile_browser
if detect_mobile_browser(request.env.http_user_agent):
mobile_view = '%s.mobile.%s' % (request.function, request.extension)
if os.path.exists(os.path.join(request.folder, 'views',request.controller, mobile_view)):
response.view = '%s/%s' % (request.controller, mobile_view)
@rochacbruno
rochacbruno / controller.py
Created May 27, 2011 23:55
ORM inside web2py modules
import myapi
orm = myapi.ORM() #database created, migrated, defined
company = orm.new_company(name='Google Inc.') #New company created or validation errors returned
client = orm.new_client(name='John', company_id=company.id) # new client created
# you could call inline
client = orm.new_client(name='John', company_id=orm.new_company('Google Inc.'))
@lucasdavila
lucasdavila / sending_email_in_gae_using_web2py_mail_api.py
Created May 28, 2011 13:02
Sending email in GAE using web2py Mail API
"""
a alguns dias acompanhei pela lista brasileira do Web2py que alguns usuários estavam
com dificuldades com envio de email no GAE, hoje passei por isso :( segue dica para
quem também estiver com dificuldades no envio de email pelo GAE.
Em um modelo ex: "models/db.py" inclua o código abaixo:
"""
from gluon.tools import Mail
@jberkel
jberkel / gist:1087757
Created July 17, 2011 16:33
HOWTO: compile mkbootimg/mkbootfs
get Android source code: http://source.android.com/source/downloading.html
$ cd /path/to/android-src
$ cd system/core/libmincrypt/
$ gcc -c *.c -I../include
$ ar rcs libmincrypt.a *.o
$ cd ../mkbootimg
$ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
$ cd ../cpio
$ gcc mkbootfs.c -o mkbootfs -I../include
@baali
baali / speech2text.py
Created December 6, 2011 04:03
A Python script to break audio into chunks of smaller audios and using Google API to get Speech to Text.
'''
A hack based on this http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/. While with smaller voice samples google speech to text works really good, as length increases quality decreases. So here using audiolab and numPy we are breaking audio sample, in smaller chunks, and removing blank/empty spaces from audio signal and then pushing them to google for processing.
It takes wav file format as input but can be changed to other formats too.
'''
from scikits.audiolab import wavread, play, flacwrite
from numpy import average, array, hstack
import os
import sys
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu

#Understanding MVC And MVP (For JavaScript & Backbone Developers)

Before exploring any JavaScript frameworks that assist in structuring applications, it can be useful to gain a basic understanding of architectural design patterns. Design patterns are proven solutions to common development problems and can suggest structural paradigms to help guide us in adding some organization to our application.

I think patterns are exciting as they're effectively a grass roots effort that build upon the collective experience of skilled developers who have previously faced similar problems as we do now. Although developers 10 or 20 years ago may not have been using the same programming languages for implementing patterns, there are many lessons we can learn from their efforts.

In this section, we're going to review two popular patterns - MVC and MVP. The context of our exploration will be how these patterns are related to the popular JavaScript framework Backbone.js, which will be explored in greater detail later on.