Skip to content

Instantly share code, notes, and snippets.

View Rydgel's full-sized avatar
😂
💯 🔥

Jérôme Mahuet Rydgel

😂
💯 🔥
View GitHub Profile
@aryairani
aryairani / AsyncHttpTask.scala
Last active August 29, 2015 14:12
Rewritten AyncHttpClient example for Tim
/**
* Created by arya on 1/2/15.
*/
/*
scalaVersion := "2.11.4"
libraryDependencies += "com.ning" % "async-http-client" % "1.9.3"
libraryDependencies += "org.scalaz" %% "scalaz-concurrent" % "7.1.0"
@renestalder
renestalder / README.md
Last active August 10, 2025 12:00
Unfollow all on Facebook

Facebook: Unfollow people and pages

See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. Run the script in your browser console

Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.

@divarvel
divarvel / continuation.js
Last active May 11, 2018 08:57
Continuation monad in JS. just run $ node continuation.js
console.log("\033[39mRunning tests…");
function assertEquals(actual, expected, description) {
if(typeof(actual) === "undefined") {
console.error("\033[31m" + description + " not implemented\033[39m");
} else {
if(actual !== expected) {
console.error("\033[31m" + description + " failed, expected " + expected + ", got " + actual + "\033[39m");
} else {
console.log(description + " \033[32m ok\033[39m");
}
@ifesdjeen
ifesdjeen / Haskell Simplification 1.hs
Last active February 11, 2018 13:05
I've got that piece of code that looks extremely overcomplicated to me. Even though every operation by itself is simple, the "sum" of operations is simply insane.
data Query = Query
data SomeObj = SomeObj
data IoOnlyObj = IoOnlyObj
data Err = Err
-- There's a decoder function that makes some object from String
decodeFn :: String -> Either Err SomeObj
decodeFn = undefined
-- There's a query, that runs against DB and returns array of strings
@pjrt
pjrt / TypeclassBox.hs
Last active July 26, 2018 08:55
A Typeclass Box in Haskell. Allows for a single type to represent any type that responds to a typeclass.
{-# LANGUAGE GADTs, ConstraintKinds, FlexibleInstances, RankNTypes #-}
-- Our typeclass with a simple foo :: a -> String func
class Foo a where
foo :: a -> String
-- Our test data types and their instances of Foo
data MyFoo = MyFoo String
data MyBar = MyBar Int
@ChristopherBiscardi
ChristopherBiscardi / Data.Haxl.Postgres.DataStoreExample.hs
Created July 5, 2014 01:44
A naive Haxl example Postgres DataStore
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Data.Haxl.Postgres.DataStoreExample
@staltz
staltz / introrx.md
Last active September 5, 2025 10:20
The introduction to Reactive Programming you've been missing
@Rydgel
Rydgel / core.clj
Created June 20, 2014 14:36
Print finished World Cup match results
(ns wc.core
(:require [clj-http.client :as client]))
(defn print-matchs-over []
(let [data-request (client/get "http://worldcup.sfg.io/matches" {:as :json-strict})
completed (filter #(= (:status %) "completed") (:body data-request))]
(doseq [{home-team :home_team away-team :away_team} completed]
(println (str (:country home-team) " " (:goals home-team) " x "
(:country away-team) " " (:goals away-team))))))
@lloydmeta
lloydmeta / TwitterFutureSupport.scala
Last active August 29, 2016 22:59
Implicit conversion from a Twitter Future to a Scala Future
import com.twitter.util.{Future => TwitterF}
import scala.concurrent.{Future => ScalaF, Promise => ScalaP}
object TwitterFutureSupport {
/**
Implicit conversion from a Twitter Future to a Scala Future
**/
implicit def twitterFutureToScalaFuture[T](twitterF: TwitterF[T]): ScalaF[T] = {
val scalaP = ScalaP[T]
twitterF.onSuccess { r: T =>
@rtt
rtt / tinder-api-documentation.md
Last active August 6, 2025 20:54
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)