Skip to content

Instantly share code, notes, and snippets.

View cosminstn's full-sized avatar
🎯
Focusing

Cosmin Stoian cosminstn

🎯
Focusing
  • Bucharest, Romania
View GitHub Profile
@functicons
functicons / serialize-deserialize-lambda-and-class.java
Created June 7, 2018 04:32
Serialize and deserialize Java lambda functions and classes.
package com.example;
import java.io.*;
import java.util.function.Function;
/**
* Serialize and deserialize lambda functions and classes.
*/
public class Main {
public static void main(String[] args) throws Exception {
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 6, 2025 14:57
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@pablomoretti
pablomoretti / gist:9748230
Created March 24, 2014 20:17
SimpleDateFormatThreadSafe
package com.foocoders.text;
import java.text.AttributedCharacterIterator;
import java.text.DateFormatSymbols;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;