Skip to content

Instantly share code, notes, and snippets.

View atufkas's full-sized avatar
🎸
Rock 'n' Roll

Matthias Lienau atufkas

🎸
Rock 'n' Roll
View GitHub Profile
@coryhouse
coryhouse / InlineAlert.tsx
Last active April 14, 2021 07:34
Only allow certain child element types in React component
import React, { Suspense } from "react";
import "./InlineAlert.scss";
import cx from "classnames";
import * as ReactIs from "react-is";
const allowedChildren = ["string", "span", "em", "b", "i", "strong"];
type InlineAlertProps = {
/** Message to display */
children: React.ReactNode;
@soerenbernstein
soerenbernstein / RevisionsCleanupCommand.php
Created April 21, 2016 06:36
Revisions cleanup for SimpleThings/EntityAudit as symfony command
<?php
/**
* Created by PhpStorm.
* User: Sören Bernstein
* Date: 15.09.2015
* Time: 12:57
*/
namespace Redlink\CASBundle\Command;
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@scottdweber
scottdweber / ExpandingCircleAnimationDrawable.java
Created March 22, 2013 02:14
An example showing how to create and use a Drawable that animates.
package com.example.manualanimation;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.view.animation.AnimationUtils;
@domenic
domenic / di-in-requirejs.js
Created October 10, 2011 04:05
Dependency injection sample with RequireJS
// EntryPoint.js
define(function () {
return function EntryPoint(model1, model2) {
// stuff
};
});
// Model1.js
define(function () {
return function Model1() {
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');