Skip to content

Instantly share code, notes, and snippets.

@abecoffman
abecoffman / functions.php
Created March 13, 2011 23:21
Adds Facebook SDK to Wordpress
<?php
function facebook_sdk_init() {
wp_enqueue_script('jquery');
// instruction to only load if it is not the admin area
if ( !is_admin() ) {
// register and load the facebook sdk
wp_register_script( 'facebook-sdk',
'http://connect.facebook.net/en_US/all.js',
array(), '', TRUE);
@manuel
manuel / representing-monads.scm
Created August 28, 2012 00:08
Error monad from Filinski's "Representing Monads"
;; Error monad from Filinski's "Representing Monads"
(define *default-prompt* (make-prompt))
(define (reflect m) (shift *default-prompt* k (ext k m)))
(define (reify t) (push-prompt *default-prompt* (unit (t))))
(define-record-type Success
(make-success a)
success?
@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@ilyaigpetrov
ilyaigpetrov / Meteor Alternatives Per Feature.md
Last active September 15, 2024 20:21
Meteor Alternatives Per Feature | by https://git.io/ilyaigpetrov

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.
@stereokai
stereokai / gist:36dc0095b9d24ce93b045e2ddc60d7a0
Last active January 6, 2025 16:03
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
@lifehome
lifehome / webhook.gs
Created August 24, 2016 14:48
Google Forms + Webhook : JSON example
function onFormSubmit(e) {
var data = {
"form": {
"id": e.source.getId(),
"title": e.source.getTitle() ? e.source.getTitle() : "Untitled Form",
"is_private": e.source.requiresLogin(),
"is_published": e.source.isAcceptingResponses(),
},
"response": {
"id": e.response.getId(),
@milankinen
milankinen / main.js
Last active October 24, 2016 20:42
CULLI teaser
import * as O from "most"
import {run} from "@cycle/most-run"
import DOM from "@culli/dom"
import Store, {Memory} from "@culli/store"
import HTTP from "@culli/http"
run(GithubSearch, {
DOM: DOM("#app"),
// create store using in-memory persintence
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 9, 2025 14:04
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.