Skip to content

Instantly share code, notes, and snippets.

Avatar

Ralph Sto. Domingo ralphstodomingo

View GitHub Profile
@ralphstodomingo
ralphstodomingo / System Design.md
Created Oct 7, 2020 — forked from vasanthk/System Design.md
System Design Cheatsheet
View System Design.md

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ralphstodomingo
ralphstodomingo / cors-config.xml
Created May 7, 2019 — forked from stomita/cors-config.xml
S3 CORS configuration sample
View cors-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@ralphstodomingo
ralphstodomingo / Equity.md
Created Apr 24, 2019 — forked from isaacsanders/Equity.md
Joel Spolsky on Equity for Startups
View Equity.md

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

View gist:e77cee67d25ecae88648bdeb92608987
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
View FilesController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use File as FileO;
use App\File;
use App\Folder;
View gulpfile.js
var Q = require('q');
var childProcess = require('child_process');
var asar = require('asar');
var jetpack = require('fs-jetpack');
var projectDir;
var buildDir;
var manifest;
var appDir;
function init() {
View gist:a02d95c363d4d35ed06f97ed3fa28ca5
------------------------
Loop No. 0
------------------------
Float addition test
(9.567591311435566e-36,2.5223372357846707e-44) + (174064102539264,4462747)
------------------------
CPU output: (174064102539264,4462747) = 174064107002011
GPU output: (174064102539264,4462747,0,1) = 174064107002011
View sampleController.js
primesis.controller('SampleController', function SampleController($q){
$scope.flag = false;
var loadSearch = function(term){
var deferObject = $q.deferred;
$http.get('url', data).then( function(response){
deferObject.resolve(response);
}, function(rejection){
deferObject.reject(rejection);