Skip to content

Instantly share code, notes, and snippets.

View MichaelFBA's full-sized avatar
🙃

Michael Bell MichaelFBA

🙃
  • GetYourGuide
  • Zürich
View GitHub Profile
@charlesteh
charlesteh / cf-workers-ai-bge-small.js
Last active March 21, 2024 07:06
Cloudflare Workers AI baai/bge-small deployment script
// Made by @charlestehio: https://x.com/charlestehio
// Usage: https://abc.workers.dev/?query=your%20embedding%20query
import { Ai } from './vendor/@cloudflare/ai.js';
export default {
async fetch(request, env) {
// Parse the URL to get query parameters
const url = new URL(request.url);
var query = url.searchParams.get('query');
@yzziizzy
yzziizzy / sfm.sh
Last active February 5, 2021 05:58
Script for creating a mesh from pictures or video of an object. Uses colmap and OpenMVS. ffmpeg and exiftool are required to use video input.
#!/bin/bash
############
# Errors #
############
#
# "PyramidCU::GenerateFeatureList: an illegal memory access was encountered"
# --> close ALL 3D applications (meshlab, colmap, CloudCompare), including webgl tabs
#
# falure at the mapper stage:
@LeCoupa
LeCoupa / meteor.ssl.nginx
Last active January 23, 2022 07:57
How to deploy a Meteor application with SSL on Nginx --> https://github.com/LeCoupa/awesome-cheatsheets
# Note: if you want to run multiple meteor apps on the same server,
# make sure to define a separate port for each.
# Upstreams
upstream gentlenode {
server 127.0.0.1:58080;
}
# HTTP Server
server {
@Whoaa512
Whoaa512 / client_main.js
Last active February 6, 2018 04:49
Meteor code to display user's facebook picture
Meteor.startup(function() {
Template.fb_pic.pic = function() {// helper function to display the pic on the page
var userProfile;
userProfile = Meteor.user().profile;
if(userProfile) { // logic to handle logged out state
return userProfile.picture;
}
};
});
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@mhawksey
mhawksey / gist:1276293
Last active October 23, 2023 09:00
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software