Skip to content

Instantly share code, notes, and snippets.

View michal-lipski's full-sized avatar
🏠
Working from home

Michal Lipski michal-lipski

🏠
Working from home
View GitHub Profile
/* Extra Small Devices, .visible-xs-* */
@media (max-width: 767px) {
h1 {
font-size: 26px;
}
}
/* Small Devices, .visible-sm-* */
@media (min-width: 768px) and (max-width: 991px) {
h1 {
@michal-lipski
michal-lipski / hackathons.md
Last active May 26, 2017 10:13
Pragmatists Hackathons

Case 1: Open source hackathon

How?

  • Pick up some open source project. Might be one that you are using
  • Checkout issues list or request a new feature
  • fix issues and implement features on hackathon

Pros

  • easy to start - no need for bootstrapping environment and gathering specification before hackathon
  • easy to have closure after one day of hackathon. One can pick issue of size that he can complete during one day.
  • good feeling of contributing stg useful to tools that we use for free
@michal-lipski
michal-lipski / gist:9803947
Last active August 29, 2015 13:57
App development with angular and tests - examples from lecture
@michal-lipski
michal-lipski / dabblet.css
Created November 21, 2013 18:33
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@michal-lipski
michal-lipski / demo.java
Last active December 25, 2015 00:29
Strange behavior when extracting method
//code before extracting method from part marked with <selection>:
float discount;
//some code
<selection>
discount = 0 ;
if (unitPricePerQuantity() >= 100) {
discount = unitPricePerQuantity() * 10 / 100;
}
</selection>
@Test
public void employee_on_full_month_sick_leave_gets_special_salary_type() throws Exception {
Calendar start = Calendar.getInstance();
start.set(Calendar.YEAR, 2011);
start.set(Calendar.MONTH, DECEMBER - 1); // Januar = 0
start.set(Calendar.DAY_OF_MONTH, 1);
Calendar end = Calendar.getInstance();
start.set(Calendar.YEAR, 2011);
start.set(Calendar.MONTH, DECEMBER - 1); // Januar = 0
start.set(Calendar.DAY_OF_MONTH, 31);
@Test
public void document_from_my_company_are_visible_to_me() throws Exception {
Document document = new Document(DOC_ID).company(ORG_ID);
when(documentManagementService.findById(DOC_ID)).thenReturn(document);
when(userContext.getMyCompanyId()).thenReturn(ORG_ID);
boolean accessibleToMe = permissionService.isDocumentAccesibleToMe(DOC_ID);
assertThat(accessibleToMe).isTrue();
}
@michal-lipski
michal-lipski / common oracle sql
Last active December 21, 2015 12:18
Oracle common sqls
--List all users who have been assigned a particular role
select * from dba_role_privs where granted_role = 'DBA'
--List all roles given to a user
select * from dba_role_privs where grantee = 'PHIL';
@michal-lipski
michal-lipski / gist:5927367
Created July 4, 2013 12:40
Start h2 database web server on memory db
org.h2.tools.Server.startWebServer(new JdbcConnection("jdbc:h2:mem:msp",new Properties()));
@michal-lipski
michal-lipski / filter_branch_instructions
Last active December 15, 2015 21:29
Move Folders Between Git Repositories preserving history using filter-branch
Create clean clone of the source repository:
git clone git://server.com/my-repo1.git
Nuke all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need.
Create a branch for changes.
git checkout -b repo1_branch