Skip to content

Instantly share code, notes, and snippets.

View yuinchien's full-sized avatar

yuin yuinchien

View GitHub Profile
@yuinchien
yuinchien / glossary.md
Last active February 3, 2024 16:31
AI Glossary
TERM DEFINITION SOURCE LINK
AGI. Artificial General Intelligence An AGI could learn to accomplish any intellectual task that human beings or animals can perform. Alternatively, AGI has been defined as an autonomous system that surpasses human capabilities in the majority of economically valuable tasks. Source
Adversarial suffix A string of random seeming characters, to a prompt that makes the LLM significantly more likely to return an unfiltered response. Source Demo
AI. Artificial Intelligence Artificial intelligence (AI) is the intelligence of machines or software, as opposed to the intelligence of humans or animals. It is a field of study in computer science which develops and studies intelligent machines. [Source](https://en.wikipedia.org/wiki/Artificial
@yuinchien
yuinchien / login.js
Created March 30, 2017 21:35
Client side js for login
'use strict';
function Login() {
document.addEventListener('DOMContentLoaded', function() {
// Shortcuts to DOM Elements.
this.signInButton = document.getElementById('demo-sign-in-button');
this.signOutButton = document.getElementById('demo-sign-out-button');
this.nameContainer = document.getElementById('demo-name-container');
this.uidContainer = document.getElementById('demo-uid-container');
this.deleteButton = document.getElementById('demo-delete-button');
@yuinchien
yuinchien / app.js
Created March 30, 2017 21:29
node.js file
// Modules imports
const express = require('express');
const cookieParser = require('cookie-parser');
const crypto = require('crypto');
// Load config file
const config = require('./config.json');
// Firebase Setup
const admin = require('firebase-admin');
@yuinchien
yuinchien / signal.js
Created April 1, 2012 02:54
js signal & simple inheritance
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};
@yuinchien
yuinchien / gist:1490936
Created December 17, 2011 18:14
Drag and drop file from desktop to browser
$("#holder").bind('dragover',function(){return false;}).bind('drop', function(e){
var holder= this;
e = (e&&e.originalEvent?e.originalEvent:window.event) || e;
if(e.preventDefault){
e.preventDefault();
}
var files = (e.files||e.dataTransfer.files);
var s = "";