Skip to content

Instantly share code, notes, and snippets.

View carloscasalar's full-sized avatar
💜
Helping make cities a better place to live at @cabify

Carlos Castillo carloscasalar

💜
Helping make cities a better place to live at @cabify
View GitHub Profile

How to calculate your hourly rate as a freelancer?

Many people struggle with this question. Some just try to make as much as a full-time employee makes (and ignore that they won't be able to bill as many days). Others follow tips on startup related websites that suggest to ask for 20% to 50% more than an salary would yield (and ignore the additional risk and expenses they have).

Below you will find some numbers to help you calculate how high your hourly or daily rate should be.

Your yearly income should be higher than an average salary

  • You take more risk than full time employees, phases without income are likely
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved

Intercom user_hash

Remember that your secret key should never be exposed to the public

  • So Javascript code below should only be used for testing unless modified and used to run on a server
@coryhouse
coryhouse / package.json
Last active April 26, 2024 13:01
Example of calling one script from another
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"clean": "rimraf ./dist && mkdir dist",
"prebuild": "npm run clean",
"build": "cross-env NODE_ENV=production webpack"
}
}
@nahuelsotelo
nahuelsotelo / error.js
Last active April 20, 2016 09:23
ERROR HANDLER
var beep = require('beepbeep');
var colors = require('colors');
var onError = function(err) {
beep([200, 200]);
var formatOutput = function(context) {
var msg, file, line, description;
if(context == 'gulp-babel') {
@briceburg
briceburg / Dockerfile
Last active August 21, 2021 06:02
laravel 5 - running in a docker container
FROM alpine
ENV \
APP_DIR="/app" \
APP_PORT="80"
# the "app" directory (relative to Dockerfile) containers your Laravel app...
COPY app/ $APP_DIR
RUN apk add --update \
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@danharper
danharper / CatchAllOptionsRequestsProvider.php
Last active April 20, 2024 01:53
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@busypeoples
busypeoples / AngularJS-ES6-Test-Skeleton
Last active June 6, 2020 01:29
AngularJS - Karma, Jasmine, Browserify, Stringify - ES6 Test Setup
We couldn’t find that file to show.