Skip to content

Instantly share code, notes, and snippets.

@bluetidepro
bluetidepro / remove-advertisers.js
Last active December 29, 2023 06:27
Auto click "remove" on all facebook advertisers and Twitter interests
// I did this in Chrome...
//
// Go to https://www.facebook.com/ads/preferences/
// Click the "Advertisers" section to open it up.
// Click "See more" once
// Before doing anything else, just keep clicking space bar to trigger the "see more" button
// Do this for a bit until all the advertisers are loaded
// then run this below in the dev tools console...
// (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them)
@sgdan
sgdan / gzip.kts
Last active April 4, 2024 06:02
Kotlin code to compress/uncompress a string with gzip
import java.io.ByteArrayOutputStream
import java.io.File
import java.nio.charset.StandardCharsets.UTF_8
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
fun gzip(content: String): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(content) }
return bos.toByteArray()
@wcravens
wcravens / gist:0e1e423ce1823b718b9d5b1ddf6acffa
Last active March 24, 2021 13:53 — forked from mikehaertl/gist:3258427
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileTreeElement
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.internal.tasks.DefaultScalaSourceSet
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.reporting.ReportingExtension
import org.gradle.api.tasks.ScalaRuntime
@nschwermann
nschwermann / README.md
Created May 16, 2013 18:03
Solarized IntelliJ Theme

This tweaks the darcula IntelliJ theme to better match the solarized color scheme found here https://github.com/jkaving/intellij-colors-solarized

To enable, after installing the color scheme linked above set your theme to darcula.

Preferences -> Appearance -> Theme -> Darcula

Exit IntelliJ then add the tweaked darcula properties file to the idea.jar file with the following command

jar -ufv idea.jar com/intellij/ide/ui/laf/darcula/darcula.properties 
@owainlewis
owainlewis / routes.clj
Created January 9, 2013 17:05
Testing Compojure applications in the REPL.
(defroutes app
(GET "/" [] "<h1>Index route</h1>")
(route/not-found "<h1>Page not found</h1>"))
(defn fake-request [routes uri method & params]
(let [localhost "127.0.0.1"]
(routes {:server-port 80
:server-name localhost
:remote-addr localhost
:uri uri
@ttscoff
ttscoff / searchlink.rb
Last active February 26, 2024 07:05
SearchLink creates Markdown links from automatic searches based on special syntax.
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.TextView;
import com.github.jobs.BuildConfig;
import java.util.ArrayList;
import java.util.List;