Skip to content

Instantly share code, notes, and snippets.

View martinadamek's full-sized avatar

Martin Adamek martinadamek

View GitHub Profile
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index fbcd58d..2491aa5 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -1,7 +1,7 @@
<% content_for :form_block do %>
<div class="mb-4 text-center">
<h2 class="mb-px"><%= t('.sign_in') %></h2>
- <%= t ".sign_up_html", link: link_to("sign up for an account", new_registration_path(resource_name), class: "font-semibold") %>
+ <%#= t ".sign_up_html", link: link_to("sign up for an account", new_registration_path(resource_name), class: "font-semibold") %>
@martinadamek
martinadamek / Pokus.java
Created September 28, 2016 07:36
Pokus
class Pokus {
}
@martinadamek
martinadamek / snapshot.sh
Created February 26, 2012 19:12
Shell wrapper for snapshot.py
monkeyrunner snapshot.py $1
@martinadamek
martinadamek / snapshot.py
Created February 26, 2012 19:11
Android screen snapshot from command line
# how to run: monkerunner snapshot.py [filename]
import datetime, sys
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
if len(sys.argv) > 1:
filename = sys.argv[1]
if not filename.endswith(".png"):
filename = "%s.png" % filename
else:
now = datetime.datetime.now()
int maxWidth = viewHolder.viewGroup.getWidth();
TextPaint textPaint = viewHolder.titleView.getPaint();
String title = cursor.getString(ArticlesQuery.TITLE);
int chars = textPaint.breakText(title, true, maxWidth, null);
if (chars < title.length()) {
title = title.substring(0, chars);
}
viewHolder.titleView.setText(title);
<TextView android:text="martinadamek.com"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?bigLabel"/>
<style name="Theme.Themeswitch.Light" parent="android:style/Theme.Light">
<item name="bigLabel">@style/ShadowedLabel.Light</item>
</style>
<style name="Theme.Themeswitch.Black" parent="android:style/Theme.Black">
<item name="bigLabel">@style/ShadowedLabel.Black</item>
</style>
<style name="ShadowedLabel">
<!-- all the common properties -->
<resources>
<attr name="bigLabel" format="reference" />
</resources>
@martinadamek
martinadamek / gist:749257
Created December 21, 2010 00:00
Android Library project Test Instrumentation in AndroidManifest.xml
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="my.project.using.library"
android:label="Tests for my.library.project"/>
@martinadamek
martinadamek / IncreaseCtr.java
Created December 16, 2010 14:58
Increasing AFMA CTR by guessing the country
void increaseCtr(List<AdSpec.Parameter> params) {
String countryCode = Locale.getDefault().getCountry();
params.add(new Parameter("gl", countryCode));
}