Skip to content

Instantly share code, notes, and snippets.

View maluramichael's full-sized avatar
🏠
Working from home

Michael maluramichael

🏠
Working from home
View GitHub Profile
@dbu
dbu / DoctrineEncryptListener.php
Last active February 10, 2024 11:18
encrypting doctrine fields
<?php
namespace App\EventListener;
use App\Doctrine\Encryption\EncryptingEntityInterface;
use App\Doctrine\Encryption\EncryptorInterface;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreFlushEventArgs;
use Doctrine\ORM\Events;
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@mbinna
mbinna / effective_modern_cmake.md
Last active May 24, 2024 07:26
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@mayel
mayel / up
Last active January 2, 2022 01:11
up: script to keep your Mac up-to-date (both OS and Homebrew updates) via the command line
replaced by https://gist.github.com/mayel/c07bc0acb91824501d5bdbdc9eb7b33a
@derlarsen
derlarsen / pre-commit
Created June 21, 2017 10:23
Pre-commit hook for ESLinting that works with sourcetree
# !/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
HAS_NODE=`which node 2> /dev/null || which nodejs 2> /dev/null || which iojs 2> /dev/null`
@darth-veitcher
darth-veitcher / bash-pid.md
Created January 8, 2017 22:13
Bash Script PID file locking

Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.

Useful for things like rsync tasks.

PIDFILE=/var/run/myscriptname.pid

if [ -f $PIDFILE ]
then
 PID=$(cat $PIDFILE)
@epixoip
epixoip / 8x1080.md
Last active March 20, 2024 17:14
8x Nvidia GTX 1080 Hashcat Benchmarks
@liamzebedee
liamzebedee / BackgroundTask.h
Last active February 18, 2024 09:27
Attempts at implementing background tasks in React Native iOS
//
// BackgroundTask.h
// tomtrack
//
// Created by Liam Edwards-Playne on 13/02/2016.
//
#import "RCTBridgeModule.h"
@interface BackgroundTask : NSObject <RCTBridgeModule>
@ramiabraham
ramiabraham / rom_suffix_codes.md
Last active April 27, 2024 13:28
Video game rom suffix codes (decoded)

Video game rom codes

You wouldn't download a car...


Primary rom codes

Probably what you're looking for

  • [a] Alternate (alternate version of the game, usually trying a different output method)
  • [p] Pirate
@bogas04
bogas04 / react-component.md
Last active February 23, 2016 20:47
Bash function to create react-component folder

React component

A quick shell script function to create a directory following react-style-guide

# React component
rc () { 
mkdir $1;
touch "$1/index.js";
echo "import React, { Component } from 'react';