This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| """ | |
| This fabric file makes setting up and deploying a django application much | |
| easier, but it does make a few assumptions. Namely that you're using Git, | |
| Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
| Django installed on your local machine and SSH installed on both the local | |
| machine and any servers you want to deploy to. | |
| _note that I've used the name project_name throughout this example. Replace | |
| this with whatever your project is called._ |
| <?php | |
| /* | |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| <?php | |
| class Model_Acl extends Zend_Acl { | |
| public function __construct() { | |
| // define Roles | |
| $this->addRole(new Zend_Acl_Role('guest')); // not authenicated | |
| $this->addRole(new Zend_Acl_Role('member'), 'guest'); // authenticated as member inherit guest privilages | |
| $this->addRole(new Zend_Acl_Role('admin'), 'member'); // authenticated as admin inherit member privilages |
| <?php | |
| require_once 'app/Mage.php'; | |
| Mage::app(); | |
| mysql_connect(localhost, DATABASE_USER, DATABASE_PASSWORD); | |
| mysql_select_db(DATABASE_NAME) or die("Unable to select database"); | |
| $result = mysql_query("SELECT * FROM `catalog_product_entity_varchar` WHERE attribute_id in (74,75,76) AND value='no_selection'"); | |
| while ($row = mysql_fetch_array($result)) { |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| /* | |
| * jQuery selectbox plugin | |
| * | |
| * Copyright (c) 2007 Sadri Sahraoui (brainfault.com) | |
| * Licensed under the GPL license and MIT: | |
| * http://www.opensource.org/licenses/GPL-license.php | |
| * http://www.opensource.org/licenses/mit-license.php | |
| * | |
| * The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete) | |
| * |
| ~ ✗ diff -ruN mutex.go mutexv2.go | |
| --- mutex.go 2012-10-25 11:30:04.170656858 +0800 | |
| +++ mutexv2.go 2012-10-25 11:30:04.174656858 +0800 | |
| @@ -9,8 +9,9 @@ | |
| ) | |
| type Msg struct { | |
| - mutex sync.Mutex | |
| - count map[int64]string | |
| + rmutex sync.RWMutex |
| --- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300 | |
| +++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200 | |
| @@ -695,7 +695,9 @@ | |
| /* It is very rare that the developer ever has full control of stdin, | |
| so any use of gets warrants an unconditional warning. Assume it is | |
| always declared, since it is required by C89. */ | |
| -_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); | |
| +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) | |
| + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); | |
| +#endif |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "time" | |
| ) | |
| const numWorkers = 3 |