This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
. "github.com/maragudk/gomponents/html" | |
) | |
func HeaderView() g.Node { | |
component := Div(Class("/* inside here you get tailwind autocomplete */")) | |
return component | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
palindrome :: Eq a => [a] -> Bool | |
palindrome [] = True | |
palindrome (x:[]) = True | |
palindrome (x:_:y:[]) = x == y | |
palindrome xs | head xs /= last xs = False | |
| head xs == last xs = palindrome $ stripFirstAndLast xs | |
where stripFirstAndLast ys = tail $ reverse $ tail $ reverse ys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
func first() -> Element? { | |
if isEmpty { | |
return nil | |
} | |
return self[0] | |
} | |
func last() -> Element? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git pull | |
git add . | |
git add -u | |
git commit -m "Automatic Draft Commmit" | |
git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
// Some code that can fail | |
} | |
catch(NumberFormatException e) | |
{ | |
Log.v(TAG, "User entered invalid data: carbs - " + carbsString + " fiberString - " + fiberString); | |
// I feel dirty for this hack | |
mCarbsAmountEditText.removeTextChangedListener(mCarbsTextWatcher); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mRadioGroup = (RadioGroup) findViewById(R.id.radioGroup); | |
mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){ | |
@Override | |
public void onCheckedChanged(RadioGroup group, int checkedId) | |
{ | |
if(checkedId == R.id.radioButtonAll) | |
{ | |
mPlacesListView.setAdapter(new KFPlaceAdapter(mActivity, allPlaces)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RadioGroup android:id="@+id/radioGroup" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:gravity="center" | |
android:background="@color/MidnightBlue" | |
> | |
<RadioButton android:id="@+id/radioButtonAll" | |
style="@style/RadioButtonStyle" | |
android:text="All" |