Skip to content

Instantly share code, notes, and snippets.

View danieldietrich's full-sized avatar
💭
📡 working from space

Daniel Dietrich danieldietrich

💭
📡 working from space
View GitHub Profile
import javaslang.collection.*;
import javaslang.*;
public class SetNarrowTest {
static class PersonBase {
public final String name;
public PersonBase(String name) {
this.name = name;
}
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@citrusui
citrusui / dropdown.md
Last active April 21, 2024 18:44
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@tduarte
tduarte / publish-ghpages.md
Last active March 15, 2024 05:45
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@ebidel
ebidel / template_vs_innerhtml.html
Last active October 7, 2019 09:50
Fastest way to create shadow DOM (.innerHTML vs. <template>)
<!doctype html>
<html>
<head>
<title>What's the fastest way to create shadow DOM</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
padding: 3em;
font-family: "Roboto", sans-serif;
@HarmJ0y
HarmJ0y / keepass2john.py
Created June 30, 2016 06:02
Python port of John the Ripper's keepass2john - extracts a HashCat/john crackable hash from KeePass 1.x/2.X databases
#!/usr/bin/python
# Python port of keepass2john from the John the Ripper suite (http://www.openwall.com/john/)
# ./keepass2john.c was written by Dhiru Kholia <dhiru.kholia at gmail.com> in March of 2012
# ./keepass2john.c was released under the GNU General Public License
# source keepass2john.c source code from: http://fossies.org/linux/john/src/keepass2john.c
#
# Python port by @harmj0y, GNU General Public License
#
var meta;
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var should = require('chai').should();
contract('HumanStandardTokenFactory', function(accounts) {
var createHumanStandardToken;
package fizzbuzz;
import javaslang.collection.Stream;
import javaslang.control.Option;
import static javaslang.control.Option.none;
import static javaslang.control.Option.some;
public class SlangFizzBuzz {
public static void main(String[] args) {
@netzwerg
netzwerg / FizzBuzz.java
Created May 1, 2016 05:06
FizzBuzz in Java 8 with Javaslang
import javaslang.collection.Stream;
/**
* An implementation of https://dierk.gitbooks.io/fregegoodness/content/src/docs/asciidoc/fizzbuzz.html
* using http://www.javaslang.io
*
* @author Rahel Lüthy
*/
public class FizzBuzz {
@maxim
maxim / gh-dl-release
Last active March 29, 2024 16:41
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#