Skip to content

Instantly share code, notes, and snippets.

View Hrissimir's full-sized avatar

Hrissimir Hrissimir

  • HEDSolutions
  • Bulgaria
View GitHub Profile
@minjejeon
minjejeon / gist:0e5562468f83274679e8bfa56fa1937e
Last active August 24, 2020 08:29 — forked from philippeowagner/gist:6530635
Having troubles with 'latin1_swedish_ci' on your MySQL Databases? Specially `OperationalError (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='")`? No problem, fix it using Django's shell.This solution is based on this http://stackoverflow.com/questions/1073295/django-character-set-w…
from django.db import connection
from django.conf import settings
cursor = connection.cursor()
cursor.execute('SHOW TABLES')
results=[]
for row in cursor.fetchall():
results.append(row)
for row in results:
cursor.execute('ALTER TABLE %s CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' % (row[0]))
@lucindo
lucindo / log4j.java
Created October 18, 2016 19:26
Quick&Dirty Log4J conf (inline)
import java.util.Properties;
import org.apache.log4j.PropertyConfigurator;
class MyDummyApp {
public static void main(String []args) {
Properties properties=new Properties();
properties.setProperty("log4j.rootLogger","DEBUG,stdout");
properties.setProperty("log4j.rootCategory","DEBUG");
properties.setProperty("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender");
@rahman99
rahman99 / SimpleCode
Last active April 25, 2020 00:23
Log4j without log4j.properties
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
public class ProgramaticLog4j {
public static void main(String[] arg){
PatternLayout layout = new PatternLayout();
@lparoli
lparoli / LoginScreen
Last active September 21, 2017 09:19
Screen Object Pattern class example
package qa.com.espressospoonstructure.screenObjects;
import android.support.test.espresso.ViewInteraction;
import org.hamcrest.Matcher;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.scrollTo;
@lparoli
lparoli / BaseTestCase
Created May 4, 2015 06:53
Base class for your Espresso tests, using JUnit4.
package qa.com.espressospoonstructure.tests;
import android.app.Activity;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.test.ActivityInstrumentationTestCase2;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;