Skip to content

Instantly share code, notes, and snippets.

@anilex
anilex / gist:1220397
Created September 15, 2011 20:37 — forked from rlivsey/gist:121430
~/Sites/fortaleza[master]$ git checkout vcgames-list-all-games-page
error: Untracked working tree file 'public/flash/games/vcgames/PinBall/PinBallLogo.swf' would be overwritten by merge.
~/Sites/fortaleza[master]$ rm public/flash/games/vcgames/PinBall/PinBallLogo.swf
~/Sites/fortaleza[master*]$ git checkout vcgames-list-all-games-page
Switched to branch 'vcgames-list-all-games-page'
~/Sites/fortaleza[vcgames-list-all-games-page]$ git rebase master
First, rewinding head to replay your work on top of it...
error: Untracked working tree file 'public/flash/games/vcgames/PinBall/PinballLogo.swf' would be overwritten by merge.
could not detach HEAD
~/Sites/fortaleza[vcgames-list-all-games-page]$ mv public/flash/games/vcgames/PinBall/PinBallLogo.swf public/flash/games/vcgames/PinBall/PinballLogo.swf
@anilex
anilex / jhere.css
Created November 30, 2012 18:49 — forked from anonymous/jhere.css
Maps made simple with jHERE
/* CSS */
html,body, #mapContainer {
font-family:sans-serif;
background:#fff;
color:#444;
height:100%;
padding:0;
margin:0;
}
@anilex
anilex / primer.js
Created March 28, 2013 21:12 — forked from makinde/primer.js
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
<?php
// ------------------------------ FORM Processing ---------------------------------------
$errors = null;
$success = false;
// helper function to format form errors
function showError($e){
return "<p class='error'>$e</p>";
<?php
/**
* Front-end upload form example
* using ProcessWire Inputfields
*/
$sent = false;
$upload_path = $config->paths->assets . "files/.tmp_uploads/";
<?php
/**
* Example form using PW API
*
* A workaround to get fields display in a table
* Those fields are marked with a property added to the fields $field->tablerow
*
* Approach is to grab those fields after form is put together and maybe processed,
* loop each row and render out the fields along with possible errors and add it to a string variable $table
* while we remove the field from the form at the same time.
<?php
/**
* Front-end upload form example
* using ProcessWire Inputfields
*/
$sent = false;
$upload_path = $config->paths->assets . "files/.tmp_uploads/";
<?php
// ------------------------------ FORM Processing ---------------------------------------
$errors = null;
$success = false;
// helper function to format form errors
function showError($e){
return "<p class='error'>$e</p>";
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
<?php
// get a page
$editpage = $pages->get("/editme/");
$ignorefields = array("isOld","language_published");
$form = $modules->get("InputfieldForm");
$form->method = 'post';
$form->action = './';