Skip to content

Instantly share code, notes, and snippets.

View behrangsa's full-sized avatar
💾

Behrang Saeedzadeh behrangsa

💾
View GitHub Profile
@behrangsa
behrangsa / description.md
Last active August 29, 2015 14:10
Mobile Safari issue

Right now I managed to reproduce another issue that has affected my device for some time and it might be related:

  • Close all the tabs in Mobile Safari
  • Close Safari and wait a few seconds
  • Make sure the Google+ app is installed
  • Open Safari
  • Go to reddit.com/domain/plus.google.com
  • Click on any of the links (e.g. Material Linux distro is now Quantum OS...)
  • When the page loads, it is blank until it is scrolled a bit
class MyControoler
end
public class Logger {
private Level level = Level.WARNING;
public void setLevel(Level level) {
this.level = level;
}
public void log(Level level, { => String} message) {
if (this.level == level) {
@behrangsa
behrangsa / Level.java
Created June 4, 2011 03:01
Log Level
public enum Level {
INFO,
WARNING
}
@behrangsa
behrangsa / Main.java
Created June 4, 2011 03:02
Usage example
import java.util.Calendar;
public class Main {
private static final Logger LOG = new Logger();
public static void main(String[] args) {
LOG.setLevel(Level.WARNING);
package org.behrang.deliciouscleaner
@Grab(group = "net.sf.delicious-java", module = "delicious", version = "1.14")
import del.icio.us.Delicious
def d = new Delicious("username", "password")
def posts = d.allPosts
posts.eachWithIndex { p, i ->
println (i+1) + "/" + posts.size()
@behrangsa
behrangsa / buggy.xsl
Created June 4, 2011 03:07
Unused variable
<xsl:variable name="unusedVariable" select="util:aUtilityMethod()" />
@behrangsa
behrangsa / force.xsl
Created June 4, 2011 03:08
Force invokation of function
<xsl:comment>
<xsl:value-of select="$unusedVariable" />
</xsl:comment>
@behrangsa
behrangsa / gist:1007528
Created June 4, 2011 03:12
Dependencies
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
@behrangsa
behrangsa / gist:1007529
Created June 4, 2011 03:13
Repositories
<repositories>
<repository>
<id>jboss</id>
<url>http://repository.jboss.com/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>