Skip to content

Instantly share code, notes, and snippets.

View diegoponciano's full-sized avatar
🏠
Working from home

Diego Ponciano diegoponciano

🏠
Working from home
  • Sao Paulo - Brazil
View GitHub Profile
def update
@product = Product.find(params[:id])
respond_to do |format|
if @product.update_attributes(params[:product])
flash[:notice] = 'Product was successfully updated.'
format.html { redirect_to(admin_product_path(@product)) }
format.xml do
render :nothing => true, :status => :ok
return true
end
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@viniciusteles
viniciusteles / gist:556029
Created August 29, 2010 06:20
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@tucaz
tucaz / NUnitDataTest.cs
Created December 8, 2010 12:36
Generates one test method for each entry of external data using NUnit test framework
using NUnit.Framework;
namespace NUnitDataDriven
{
[TestFixture]
public class DataTests
{
[Test, TestCaseSource("GetDataForTesting")]
public void age_should_be_over_18(Data data)
{
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@gdamjan
gdamjan / gist:792308
Created January 23, 2011 18:38
PyQt applet for a conference timer - originally done for TEDxSkopje, can be customized for anything else
#! /usr/bin/env python3
# -*- encoding: utf8 -*-
# references:
# http://doc.qt.nokia.com/4.6/stylesheet.html
# http://doc.qt.nokia.com/4.6/statemachine-eventtransitions.html
# http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html
# http://www.ibm.com/developerworks/linux/library/l-pygen.html
normal_style = """
Adagio
After Forever
Aina
Allen & Lande
Almah
Altaria
Amaran
Andre Matos
Angra
Apocalyptica
14 Bis
AC_DC
Ac£sticos e Valvulados
Adele
Adriana Calcanhoto, Ana Carolina e Maris
Aerosmith
Aha
Air Supply
Alanis Morissette
Alceu Valenca- Elba Ramalho - Geraldo Azevedo
@balupton
balupton / README.md
Last active July 13, 2024 17:32
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
@beccasaurus
beccasaurus / MY_DEMANDS.md
Created May 6, 2011 16:12
What NuGet needs for me to not want to punch it in the face

What NuGet needs for me to not want to punch it in the face

These demands MUST be met or many kittens will meet wood chippery DOOM!

  1. I must be able to install/uninstall packages into projects from the CLI (without PowerShell)
  2. I must be able to install/uninstall packages to my system, so I don't have a 20MB+ packages directory
  3. Tools included in packages that are installed to my system must automatically be added to my PATH
  4. I must be able to install a package and just get references to its DLLs without having my Web.config transformed or abunchof random content added to my project. I should have to opt-in to these extra features. It should also become standard for package developers to provide useful executables for including/managing this content, instead of using NuGet's built in features to fill my project with crap I don't want (see: [Rails generators][])
  5. The NuGet CLI executable must be extendable. If a user installs packages to their system that contain NuGet exte