Skip to content

Instantly share code, notes, and snippets.

@saolsen
saolsen / core.clj
Last active December 14, 2015 09:29
markerbot
(ns markerbot.core
(:require [taoensso.timbre :as log]
[clojure.data.json :as json]
[clojure.string :as s]
[clj-http.client :as client])
(:import (java.net Socket)
(java.io PrintWriter InputStreamReader BufferedReader))
(:gen-class))
;; marksy
@DarrenN
DarrenN / neckbeard.coffee
Last active December 15, 2015 08:48
Little Schemin' in CoffeeScript
car = (arr) ->
arr[0]
cdr = (arr) ->
arr[1..]
# Using for loop
map = (arr, func) ->
func(r) for r in arr
@thinkaxelthink
thinkaxelthink / fizzy.coffee
Created May 20, 2013 17:14
recursive fibonacci fizzbuzz
maxFibs = 50
fibs = [1,1]
fibGen = (n) ->
if fibs[n]? is false
fibs[n] = fibGen(n - 1) + fibGen(n - 2)
fibs[n]
fizzy = (i) ->
if i is undefined then i = 0
@mediavrog
mediavrog / gist:5625602
Last active March 20, 2024 16:59
Filter out Intents you don"t want to show from a IntentChooser dialog. For example your own app, competing apps or just apps you have a share integration by SDK already :) Based on http://stackoverflow.com/questions/5734678/custom-filtering-of-intent-chooser-based-on-installed-android-package-name/8550043#8550043
// Usage:
// blacklist
String[] blacklist = new String[]{"com.any.package", "net.other.package"};
// your share intent
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "some text");
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "a subject");
// ... anything else you want to add
// invoke custom chooser
@fabiofl
fabiofl / gist:5873100
Created June 27, 2013 00:41
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@jasonofearth
jasonofearth / gist:5923351
Created July 3, 2013 22:18
Android string array of US states
<string-array name="states">
<item>Alabama</item>
<item>Alaska</item>
<item>American Samoa</item>
<item>Arizona</item>
<item>Arkansas</item>
<item>California</item>
<item>Colorado</item>
<item>Connecticut</item>
<item>Delaware</item>
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active October 22, 2025 14:53
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@philfreo
philfreo / gist:7257723
Created October 31, 2013 21:44
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
@DarrenN
DarrenN / buffer.cljs
Last active December 31, 2015 08:49
Buffered vector as a value - not stored in an atom
(ns DarrenN.stateless.buffer)
;; create-buffer returns a vector scoped to size. When new items are added
;; they are passed to functions in add-listeners. If the vector is at its
;; size limit then items are shifted off the front of the vector and
;; passed to the functions in destroy-listeners
;; Callbacks for adding/removing item from vector
(def destroy-listeners [(fn [i] (print (str i " removed")))])
(def add-listeners [(fn [i] (print (str i " added")))])