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
const fetch = require('node-fetch'); | |
var twilio = require('twilio'); | |
var accountSid = '_snip_'; // enter | |
var authToken = '_snip_'; // enter | |
var your_zip_code = "90094"; // change | |
var twilio = require('twilio'); | |
var client = new twilio(accountSid, authToken); |
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
# | |
# run from root | |
# | |
# writes to a folder "videos" folder needs to be created. | |
# requires ffmpeg installed | |
# | |
# $>ruby gifToMP4.rb | |
# | |
# | |
# references: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Contentful dependencies --> | |
<link rel="stylesheet" href="https://contentful.github.io/ui-extensions-sdk/cf-extension.css"> | |
<script src="https://unpkg.com/contentful-ui-extensions-sdk@3"></script> | |
<!-- AWS JS SDK --> | |
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.120.0.min.js"></script> |
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
# | |
# Run 'nvm use' automatically every time there's | |
# a .nvmrc file in the directory. Also, revert to default | |
# version when entering a directory without .nvmrc | |
# | |
enter_directory() { | |
if [[ $PWD == $PREV_PWD ]]; then | |
return | |
fi |
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 'aws-sdk-lambda' # https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/ruby/example_code/lambda/aws-ruby-sdk-lambda-example-run-function.rb | |
require 'json' | |
require 'sendgrid-ruby' | |
include SendGrid # https://github.com/sendgrid/sendgrid-ruby | |
Encoding.default_external = 'UTF-8' | |
class EmailSender |
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 'aws-sdk-lambda' # https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/ruby/example_code/lambda/aws-ruby-sdk-lambda-example-run-function.rb | |
require 'json' | |
require 'sendgrid-ruby' | |
include SendGrid # https://github.com/sendgrid/sendgrid-ruby | |
Encoding.default_external = 'UTF-8' | |
class EmailSender |
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 'base64' | |
require 'openssl' | |
require 'sinatra' | |
require 'sinatra/partial' | |
require 'sinatra/reloader' if development? | |
require 'resque' | |
require './email_sender' |
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 ruby | |
require 'rubygems' | |
# usage | |
# ./currently_playing.rb > currently_playing.txt | |
def osascript(script) | |
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten | |
end |
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 'rubygems' | |
require 'open-uri' | |
require 'json' | |
require 'nokogiri' | |
doc = Nokogiri::HTML(open("https://www.instagram.com/chrisallick/")) | |
data = "" | |
doc.css('script').each do |script| |
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
#https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b | |
#http://ruby-for-beginners.rubymonstas.org/writing_classes/self.html | |
#https://stackoverflow.com/questions/33768598/ruby-sha-256-hexidigest-values-are-different-from-what-python-generates | |
#import hashlib as hasher | |
require "rubygems" | |
require "digest" | |
# class Block: | |
# def __init__(self, index, timestamp, data, previous_hash): |
NewerOlder