Skip to content

Instantly share code, notes, and snippets.

@jultabary
jultabary / main.rs
Created January 15, 2022 14:20
POO in rust
use std::any::Any;
trait Animal {
fn give_my_name(&self) -> String;
fn eat(&self) {
println!("miam !!!!");
}
fn as_any(&self) -> &dyn Any;
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@wojteklu
wojteklu / clean_code.md
Last active June 26, 2024 02:00
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@PurpleBooth
PurpleBooth / README-Template.md
Last active June 25, 2024 09:23
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@vjm
vjm / install.sh
Created March 7, 2015 21:38
Raspberry Pi ELK Stack
sudo apt-get install -y supervisor
sudo mkdir /usr/share/elasticsearch
cd /usr/share/elasticsearch
sudo wget https://download.elasticsearch.org/kibana/kibana/kibana-4.0.1-linux-x64.tar.gz
sudo wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz
sudo wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz
sudo tar -zxvf elasticsearch-0.90.0.tar.gz
@Globegitter
Globegitter / es.sh
Last active November 18, 2020 12:52
Easy install for elasticsearch on Ubuntu 14.04
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
React.createBackboneComponent = function (spec, compname) {
return React.createClass(_.extend({
// Assistants
serializeState: function () {
this.replaceState(this.serialize());
},
getModel: function () {
return this.props.model;
},
el: function () {
@unruthless
unruthless / mq-boilerplate.css
Last active July 5, 2016 10:11
Media Query Boilerplate
/**
* Target styles based on screen color support
*/
/* Screen is in monochrome */
@media (monochrome) {
}
/* Screen is in color */
@media (color) {
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@juanghurtado
juanghurtado / media-queries.css
Created April 2, 2012 20:03
CSS3 Media Query Boilerplate
/* ---------------------------------------------------------------------------
Boilerplate CSS Media Queries
Encoding: UTF-8
Author: PaulUnd (http://www.paulund.co.uk/boilerplate-css-media-queries)
--------------------------------------------------------------------------- */
/* =Smartphones (portrait and landscape)
--------------------------------------------------------------------------- */
@media only screen