Skip to content

Instantly share code, notes, and snippets.

@BrendanEich
BrendanEich / gist:5753666
Created June 11, 2013 00:36
ES6 version of Peter Norvig's Sudoku solver originally written in Python
// XXX should be standard (and named clone, after Java?)
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their iterator.
Array.prototype.contains = String.prototype.contains = function (e) {
@jhusain
jhusain / MyFree.purs
Created January 17, 2018 17:57
MyFree implementation
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Foldable (fold)
import TryPureScript (DOM, h1, h2, p, text, list, indent, link, render, code)
type Video = { name:: String }
@kabili207
kabili207 / Rclone systemd service.md
Last active May 6, 2024 03:20
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = true,
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = false,
// what's a better way?
let fullName (first,last) =
match (first, last) with
"",_ | null,_ -> first
| _,null | _,"" -> last
| _ -> sprintf "%s.%s" first last
@lukebrandonfarrell
lukebrandonfarrell / ExifData.swift
Created June 8, 2022 16:10
A Swift class for extracting exif data from URL, UIImage or Data types 🔭
//
// ExifData.swift
// Qeepsake
//
// Created by Luke Farrell on 26/05/2022.
//
import Foundation
import ImageIO
@mattpodwysocki
mattpodwysocki / nodeconf_2011.md
Created May 7, 2011 02:03 — forked from guybrush/nodeconf_2011.md
a list of slides from nodeconf 2011
@mattpodwysocki
mattpodwysocki / download-entries.ps1
Created November 29, 2011 21:58 — forked from jongalloway/download-entries.ps1
Download entries from NuGet
# --- settings ---
$feedUrlBase = "http://go.microsoft.com/fwlink/?LinkID=206669"
# the rest will be params when converting to funclet
$latest = $true
$overwrite = $false
$top = 5000 #use $top = $null to grab all
$destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocal"
# --- locals ---
$webClient = New-Object System.Net.WebClient