Skip to content

Instantly share code, notes, and snippets.

View josefadamcik's full-sized avatar

Josef Adamčík josefadamcik

View GitHub Profile
<?php
class BaseDoctrineForm extends sfFormDoctrine
{
public function __construct($object = null, $options = array(), $CSRFSecret = null)
{
parent::__construct($object, $options, $CSRFSecret);
// tell the widget schema which fields are required
$this->widgetSchema->addOption('required_fields', $this->getRequiredFields());
@josefadamcik
josefadamcik / gist:1082091
Created July 14, 2011 08:18
GMAP fit markers to view
var targetBounds, i, markerPositions;
markerPositions = ; //pole objektu google.mapsLatLng pro jdnotlive markery
targetBounds = new google.maps.LatLngBounds();
for (i = 0; i < markerPositions.length; i++) {
targetBounds.extend(markerPositions[i]);
}
map.fitBounds(targetBounds); //map je objekt google.maps.Map
@josefadamcik
josefadamcik / prepdeploy.php
Created August 30, 2011 09:17
little tool for deploying git project over ftp
<?php
//ftp deploy helper (git only)
$targetDir = "../webdeploy";
//$lastDeploy = "bd777c31090f9e22aef12e61f7ba64c39f09f5d0";
if (isset($argv[1])) {
$lastDeploy = $argv[1];
}
$cfgWarning = array();
Testovací<br>
<b>HTML</b>
<ul>
<li>odrazka</li>
</ul>
<a href="test">odkaz</a> a <i>kurziva</i> a <u>podtrzene</u>
<ol>
<li>cislovanay</li>
<li>seznam</li>
</ol>
new IScroll(".map-wrapper", {
//options
mouseWheel: false,
scrollbars: true,
scrollX: true,
scrollY: false,
eventPassthrough: true,
tap: true,
click:false
});
@josefadamcik
josefadamcik / MainActivity.java
Created August 7, 2018 10:15
Quick android orientation sensor test
package cz.josefadamcik.compassexperiment;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
@josefadamcik
josefadamcik / PPSimpleFastPointOverlayActivity.java
Created August 7, 2018 10:31
SO: comment - osmdroid markers
public class PPSimpleFastPointOverlayActivity extends SimpleFastPointOverlay {
private Bitmap mIcon;
public PPSimpleFastPointOverlayActivity(PointAdapter pointList, SimpleFastPointOverlayOptions style) {
super(pointList, style);
}
public PPSimpleFastPointOverlayActivity(PointAdapter pointList) {
super(pointList);
}
protected void drawPointAt(Canvas canvas, float x, float y, boolean showLabel, String label, Paint pointStyle, Paint textStyle){
@josefadamcik
josefadamcik / Lily58.kbd.json
Last active October 3, 2021 19:51
Lily58
[
{
"name": "Lily58"
},
[
{
"x": 3,
"c": "#e8e7e3",
"p": "CHICKLET",
"a": 7,
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
@josefadamcik
josefadamcik / ViewTestRule.kt
Last active February 20, 2020 08:15
ViewTestRule - for testing of isolated views using instrumented tests on android.
package ch.olmero.jo.test
import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import ch.olmero.jo.EmptyTestActivity