Mix.install([:req, :jason, :kino])
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
| { | |
| "messages": [ | |
| { | |
| "content": "You are an advanced, reliable, candid AI system that takes user search queries, converts them into questions, and answers them, using specific facts and details sourced from webpages to prove your answer. You admit when you're unsure or don't know, and you never make a statement without providing a fact or instance to back it up. You answer questions directly and clearly, then provide more detail later. You follow the JSON schema exactly.", | |
| "role": "system" | |
| }, | |
| { | |
| "content": "# CONTEXT\nCurrent date: #{DATE_TIME}.\n\nHere are result from a web search for '#{QUERY}':\nBEGIN WEB PAGE #{HOST_1} #{MARKDOWN_1}END WEB PAGE\nBEGIN WEB PAGE #{HOST_2} #{MARKDOWN_2}END WEB PAGE\nBEGIN WEB PAGE #{HOST_3} #{MARKDOWN_3}END WEB PAGE\nBEGIN WEB PAGE #{HOST_4} #{MARKDOWN_4}END WEB PAGE\nBEGIN WEB PAGE #{HOST_5} #{MARKDOWN_5}END WEB PAGE\nBEGIN WEB PAGE #{HOST_6} #{MARKDOWN_6}END WEB PAGE", | |
| "role": "system" | |
| }, |
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
| # check swap usage | |
| sysctl vm.swapusage | |
| # disable encrypted swap - SNOW LEOPARD | |
| sudo defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -boolean no | |
| # disable encrypted swap - LION | |
| sudo defaults write /Library/Preferences/com.apple.virtualMemory DisableEncryptedSwap -boolean yes | |
| # disable swap |
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 'minitest/autorun' | |
| # This should pass.. | |
| describe 'Immutable prison data' do | |
| let(:prison_name) { 'Wandsworth' } | |
| def test_data_is_treated_immutable | |
| prison1 = Prison.find prison_name |
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
| const fs = require('fs'); | |
| const https = require('https'); | |
| const axios = require('axios'); | |
| const httpsAgent = new https.Agent({ | |
| cert: fs.readFileSync('/path/to/your/certificate.pem'), | |
| key: fs.readFileSync('/path/to/your/private_key.pem'), | |
| }); | |
| const username = "token_foobarbaz" // the authorization token returned by Teller Connect |
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
| unless File.exists?("~/.todos/"), do: File.mkdir!("~/.todos/") | |
| case System.argv() do | |
| ["all"] -> | |
| if (files = File.ls!("~/.todos/")) == [], | |
| do: IO.puts("No todos."), | |
| else: Enum.each(files, &IO.puts("- #{&1}\n#{File.read!("#{"~/.todos/"}#{&1}")}\n")) | |
| ["create", todo] -> | |
| File.write!("#{"~/.todos/"}#{:os.system_time(:second)}", todo) && IO.puts("📝") |
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
| defmodule Mix.Tasks.Todo do | |
| use Mix.Task | |
| @dir "~/.todos/" | |
| def run(args) do | |
| unless File.exists?(@dir), do: File.mkdir!(@dir) | |
| case args do | |
| ["all"] -> | |
| case File.ls!(@dir) do |
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
| ## Managing RequireJS Dependency Arrays | |
| define ['jQuery','Backbone','Handlebars','AModel'], ($, _, Backbone, HB, AModel) -> | |
| ... | |
| ## VERSUS Node style requires.. | |
| define (require) -> | |
| $ = require 'jQuery' | |
| Backbone = require 'Backbone' |
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
| sourceFiles = [ '*.coffee', 'models/*.coffee', 'views/*.coffee' ] | |
| fullPathSourceFiles = sourceFiles.map (f) -> "app/coffee/" + f | |
| fullPathSpecFiles = sourceFiles.map (f) -> "specs/coffee/" + f | |
| module.exports = (grunt) -> | |
| grunt.initConfig | |
| pkg: grunt.file.readJSON 'package.json' | |
| watch: | |
| coffee: | |
| files: fullPathSourceFiles.concat(fullPathSpecFiles) |
NewerOlder