Skip to content

Instantly share code, notes, and snippets.

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

Pamela Argentino ultimagriever

🏠
Working from home
View GitHub Profile
function conectar() {
// aqui vai toda a rotina de connect...
mysql_connect(....);
}

Keybase proof

I hereby claim:

  • I am ultimagriever on github.
  • I am lastrevpamela (https://keybase.io/lastrevpamela) on keybase.
  • I have a public key whose fingerprint is 142A 5F23 04A3 11B0 9F98 EF01 26F2 5E58 34BE D912

To claim this, I am signing this object:

@ultimagriever
ultimagriever / index.js
Created May 2, 2019 21:35
Lambda Node.js Example With Swagger Specification
exports.handler = async function (event) {
// event variables looks like this:
// {
// "body": "eyJ0ZXN0IjoiYm9keSJ9",
// "resource": "/{proxy+}",
// "path": "/path/to/resource",
// "httpMethod": "POST",
// "isBase64Encoded": true,
// "queryStringParameters": {
// "foo": "bar"
@ultimagriever
ultimagriever / lambda-vpc.yml
Last active July 9, 2024 13:58
SAM Template with VPC
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
InternetGateway:
@ultimagriever
ultimagriever / random_string.js
Created February 21, 2018 13:53
Random String Generator
function generateRandomString(length = 32) {
let hash = '';
for (let i = 0; i < length; i++) {
hash += (Math.floor(Math.random() * 16)).toString(16);
}
return hash;
}
@ultimagriever
ultimagriever / heroku-config-set.sh
Last active February 10, 2017 13:30
Set Heroku config vars from .env file
# Usage: sh heroku-config-set.sh [/path/to/.env] [app-name]
ENV_FILE=$1
APP=$2
heroku config:set $(cat $ENV_FILE) -a $APP
@ultimagriever
ultimagriever / React-Native-Container-Component.js
Created January 19, 2017 20:42
IntelliJ-based File Templates for React Native
import React, { Component } from 'react';
import { View } from 'react-native';
export default class ${COMPONENT} extends Component {
render() {
return (
<View />
);
}
}
@ultimagriever
ultimagriever / export.php
Last active December 2, 2016 20:17
Export WordPress Multisite to Single Site
<?php
define("GLOBAL_URL", "insert your wordpress master url here, e.g. master domain");
// Export master blog without comments - handled by Facebook plugin
exec('wp export --url="' . GLOBAL_URL . '" --skip_comments --filename_format="{site}.{date}.xml"');
$sites = shell_exec("wp site list --url=\"" . GLOBAL_URL . "\" --field=url");
$sites = explode(PHP_EOL, $sites);
foreach ($sites as $site) {
$url = str_replace("http://", "", $site);
@ultimagriever
ultimagriever / parse.sh
Last active October 18, 2016 15:57
Parse environment files
ENV_FILE=$1
while read -r line
do
IFS="=" read -ra keys <<< "$line"
travis env set ${keys[0]} ${keys[1]} --private --no-interactive
done < $ENV_FILE
@ultimagriever
ultimagriever / configuration.sh
Created September 28, 2016 20:09
Automatically start Countdown development servers
chmod +x countdown.sh
ln -s $HOME/countdown.sh /usr/local/bin/countdown