Skip to content

Instantly share code, notes, and snippets.

View yozawiratama's full-sized avatar

Yoza Wiratama yozawiratama

View GitHub Profile
@yozawiratama
yozawiratama / FirstLastDayInWeek.cs
Last active February 10, 2023 10:51
C# .Net Get First and Last Date in a specific Week
static List<DateTime> FirstLastDayInWeek(int Year, int month, int WeekNumber)
{
WeekNumber -= 1;
DateTime start = new DateTime(Year, month, 1).AddDays(7 * WeekNumber);
start = start.AddDays(-((int)start.DayOfWeek));
return Enumerable.Range(0, 7).Select(num => start.AddDays(num)).ToList()
.Where(w => w.Year == Year && w.Month == month).ToList();
}
@yozawiratama
yozawiratama / dabblet.css
Created September 17, 2013 17:01
Untitled
html, body{
width:100%;
height:100%;
padding:0px;
margin:0px;
}
.container{
width:100%;
height:100%;
@yozawiratama
yozawiratama / Scrollediv
Last active December 19, 2015 05:49
This is an example how to create scrolled div.
.scrolled-div{
width: 900px;
height: 96%;
margin: auto;
overflow: auto;
}
.scrolled-div::-webkit-scrollbar {
width: 12px;
}
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
performSearch();
return true;
}
return false;
}
});