Skip to content

Instantly share code, notes, and snippets.

View ricklancee's full-sized avatar
💭
Edit status

Rick Lancee ricklancee

💭
Edit status
View GitHub Profile
@ricklancee
ricklancee / example-typescript-react-stateless-hoc.tsx
Last active September 18, 2021 10:18
A simple example on how to do react stateless Higher Order Components (HOC) in typescript
import * as React from 'react'
import {withInjectedProp, InjectedProps} from './simple-typescript-react-stateless-hoc'
interface Props {
bar: string
}
export const ComponentWithFoo = withInjectedProp(class extends React.Component<Props & InjectedProps, State> {
render() {
@ricklancee
ricklancee / tslint.json
Created November 27, 2017 08:33
Typescript React TSlint settings
{
"extends": ["tslint-react", "tslint-eslint-rules"],
"rules": {
"align": [ true, "parameters" ],
"array-bracket-spacing": [true, "always", { "singleValue": false, "objectsInArray": false, "arraysInArrays": false }],
"ban": false,
"block-spacing": [true, "always"],
"brace-style": [true, "1tbs"],
"class-name": true,
"comment-format": [true, "check-space"],
@ricklancee
ricklancee / NotificationFacade.php
Last active April 25, 2017 08:18
Simple laravel notification
<?php
namespace App\Services;
use Illuminate\Support\Facades\Facade;
/**
* @see \Illuminate\Session\SessionManager
* @see \Illuminate\Session\Store
*/
class NotificationFacade extends Facade
{

Keybase proof

I hereby claim:

  • I am ricklancee on github.
  • I am ricklancee (https://keybase.io/ricklancee) on keybase.
  • I have a public key whose fingerprint is D6D2 CE64 E9C0 5C9D D40F 58F5 0A35 C0A1 0129 64C2

To claim this, I am signing this object:

@ricklancee
ricklancee / script.js
Last active December 16, 2016 17:38
Script and styling to create better UX on 9anime.to; removes unnecesary items & displays watched series.
function addSeriesToStorage(series, episode) {
if (series && episode) {
let items = localStorage.getItem('w-'+series);
if (!items) {
localStorage.setItem('w-'+series, JSON.stringify([episode]));
} else {
items = JSON.parse(items);
if (items.indexOf(episode) === -1) {
items.push(episode);
@ricklancee
ricklancee / custom.zsh-theme
Last active May 21, 2016 12:21
Custom oh my zsh theme based on suvash
function prompt_char {
echo '$'
}
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")

Automate release workflow

If your project follows a semantic versioning, it may be a good idea to automatize the steps needed to do a release. Below you have a simple recipe that bumps the project version, commits the changes to git and creates a new tag.

var gulp = require('gulp');
var runSequence = require('run-sequence');
var conventionalChangelog = require('gulp-conventional-changelog');
/** Light */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'),
url('../fonts/Open_Sans/OpenSans-Light.ttf') format('ttf');
unicode-range: U+000-5FF; /* Latin glyphs */
}
@ricklancee
ricklancee / host-manager
Last active August 29, 2015 14:24 — forked from nddrylliog/host-manager
Easily edit your /etc/host file
#!/bin/bash
_hosts() {
hostfile="/etc/hosts"
addusage="Usage: `basename $0` --add address host"
remusage="Usage: `basename $0` --remove host"
case "$1" in
--add)
if [ $# -eq 3 ]; then
@ricklancee
ricklancee / Dto.php
Last active August 29, 2015 14:23
Easy -read only- access for a DTOs private properties.
<?php
final class Dto
{
use Gettable;
private $title;
private $description;
public function __construct($title, $description) {