This file contains hidden or 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 'httparty' | |
require 'jwt' | |
class FirebaseToken | |
JWT_ALGORITHM = 'RS256'.freeze | |
PUBLIC_KEY_URL = 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]'.freeze | |
def initialize(token) | |
@token = token |
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 hidden or 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
#include <errno.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <resolv.h> | |
#include <netdb.h> | |
#include <openssl/ssl.h> | |
#include <openssl/err.h> | |
//Not sure what headers are needed or not | |
//This code (theoretically) writes "Hello World, 123" to a socket over a secure TLS connection |
This file contains hidden or 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
//old: productReviews.js - lines 121 - 125 | |
async function productReviewsByProductAllGet(request, response) { | |
try { | |
const { productId } = request.params; | |
// get all reviews for a product id | |
const reviews = await productReviewsQuery.selectAllByProductId(productId); | |
const result = []; | |
// Loop from beginning of reviews array to reviews | |
for(let i = 0; i < reviews.length; i++) { |
This file contains hidden or 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
object TypeclasseDemo { | |
// The parts of the type class pattern are: | |
// | |
// 1. the "type class" itself -- a trait with a single type parameter; | |
// | |
// 2. type class "instances" for each type we care about, | |
// each marked with the `implicit` keyword; | |
// | |
// 3. an "interface" to the type class -- one or more methods |
This file contains hidden or 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
public class Backtrack { | |
public static List<List<Object>> backtrack(int[] A) { | |
// Set up a list of list to hold all possible solutions | |
List<List<Object>> result = new LinkedList<List<Object>>(); | |
if (A == null || A.length == 0) { | |
return result; | |
} | |
// As we need to recursively generate every solution, | |
// a variable is needed to store single solution. |
This file contains hidden or 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
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559 | |
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder | |
--set theLines to paragraphs of theFileContents | |
set theLines to {"task name 1", "task name 2"} | |
repeat with eachLine in theLines | |
tell application "Reminders" | |
set mylist to list "Your List Name" | |
tell mylist | |
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"} |
This file contains hidden or 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
README.txt | |
========== | |
kuromojiをrubyで利用するサンプル | |
1. kuromojiのダウンロード | |
wget https://github.com/downloads/atilika/kuromoji/kuromoji-0.7.7.tar.gz | |
tar zxf kuromoji-0.7.7.tar.gz | |
cd kuromoji-0.7.7 |