Skip to content

Instantly share code, notes, and snippets.

View felipeclopes's full-sized avatar

Felipe Lopes felipeclopes

  • Mighty Health
  • Los Angeles, CA
  • 04:38 (UTC -08:00)
  • X @felipeclopes
View GitHub Profile
@felipeclopes
felipeclopes / stripe_codes.sh
Created November 11, 2021 05:31
Create Promotional Codes on Coupons
#!/bin/sh
a=0
while [ $a -lt <totalPromoCodes> ]
do
curl -s https://api.stripe.com/v1/promotion_codes \
-u <apiKey>: \
-d coupon=<code> \
-d max_redemptions=1 | jq ".code"
@felipeclopes
felipeclopes / [email protected]
Created November 1, 2021 04:21
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@felipeclopes
felipeclopes / gist:84bdc42e5c3bf1a016a0
Created October 7, 2014 04:17
Install phantomjs in Amazon EC2
# Download and unpack distribution
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
tar xf phantomjs-1.9.7-linux-x86_64.tar.bz2
# copy binary
cd phantomjs-1.9.7-linux-x86_64
cp bin/phantomjs /usr/local/bin
cd ..
rm -rf phantomjs-1.9.7-linux-x86_64
@felipeclopes
felipeclopes / require-multiple.js.coffee
Last active December 20, 2015 02:38
AngularJS: Require Multiple for Select2 Validation
App.directive 'requiredMultiple', ->
isEmpty = (value) ->
angular.isUndefined(value) || (angular.isArray(value) && value.length == 0) || value == '' || value == null || value != value
require: '?ngModel',
link: (scope, elm, attr, ctrl) ->
return unless ctrl
attr.required = true # force truthy in case we are on non input element
validator = (value) ->
@felipeclopes
felipeclopes / rack configuration
Last active December 15, 2015 23:29
Simple rack configuration for static sites and easy heroku deployment!
use Rack::Static,
###################
# Regular expression to include all pages.
# You could also write something like ["index.html", "about_us.html"]
###################
:urls => [/./],
:root => "index.html"