This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAppyWeb.TaskTestLive.Index do | |
use MyAppWeb, :live_view | |
require Logger | |
@impl true | |
def mount(_params, _session, socket) do | |
# Trap exits to catch when a Task is forcibly cancelled. | |
Process.flag(:trap_exit, true) | |
socket = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exceptionLogging": "STACKDRIVER", | |
"dataStudio": { | |
"name": "MongoDB via mlab API - acc40", | |
"company": "Account 4.0", | |
"companyUrl": "https://acc40.com", | |
"logoUrl": "https://next-scraft.appspot.com/images/scraft.ico", | |
"addonUrl": "https://medium.com/@jsat66/mongodb-connector-for-google-data-studio-part-1-%E0%B8%AA%E0%B8%B3%E0%B8%A3%E0%B8%A7%E0%B8%88-c35eac7f2bf4", | |
"supportUrl": "https://gist.github.com/jojosati/89652770b39fd147a2484e4baf13a5ee", | |
"description": "Universal MongoDB connector." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
//Setup Hostname | |
hostnamectl set-hostname subdomain.domain.tld | |
## Basic | |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common | |
//Setup SWAP | |
sudo fallocate -l 1G /swapfile; | |
ls -lh /swapfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Multiple vulnerabilities have been disclosed in RubyGems: | |
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ | |
# | |
# And again in March 2019: | |
# https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html | |
# | |
# If you're an Rbenv user, here's any easy one-liner to upgrade to a | |
# safe version of Rubygems (2.7.8 / 3.0.3 or later) for each installed Ruby version: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update Jan 2024 | |
# Deploying Cloud Functions is much simpler than it was 6 years ago. | |
# I'm leaving the gist in it's original 2018 state for now, | |
# but skip the the recent comments below for a simpler solution. | |
variables: | |
GCP_ZONE: us-central1-a | |
stages: | |
- npm-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import needed modules | |
import quandl | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# get adjusted closing prices of 5 selected companies with Quandl | |
quandl.ApiConfig.api_key = 'INSERT YOUR API KEY HERE' | |
selected = ['CNP', 'F', 'WMT', 'GE', 'TSLA'] | |
data = quandl.get_table('WIKI/PRICES', ticker = selected, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''A python script to export the raw data from mailchimp lists and campaigns. | |
The output of this script will be a CSV file with the open and click rates for each campaign | |
and each list member (identified by an email.) You can use this data for further analysis | |
as seen here: | |
http://www.silota.com/docs/recipes/sql-email-customer-list-segmentation-lead-scoring.html | |
Written by Ganesh, 2017. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_action :cors_set_access_control_headers | |
def cors_preflight_check | |
return unless request.method == 'OPTIONS' | |
cors_set_access_control_headers | |
render json: {} | |
end | |
protected |
NewerOlder