Skip to content

Instantly share code, notes, and snippets.

Avatar
💭

Guillermo Iguaran guilleiguaran

💭
View GitHub Profile
@poteto
poteto / FBGroupMemberRemover.js
Last active Sep 11, 2019
Delete everyone from your Facebook group! Thanks for the dark UX, FB
View FBGroupMemberRemover.js
class FBGroupMemberRemover {
constructor() {
this.adminText = 'Admin';
this.removeMemberModalHeadingText = 'Remove Member';
this.memberElementSelector = '[data-name="GroupProfileGridItem"]';
this.memberContextMenuSelector = 'button[aria-label="Member Settings"]';
this.removeMemberButtonSelector = 'a[data-testid="leave_group"]'
this.removalOptions = {
@rtyler
rtyler / gist:7d9fd30a7093c7cd362b
Created Jul 25, 2015
Fun with Nashorn and JRuby
View gist:7d9fd30a7093c7cd362b
➜ ~ pry
[1] pry(main)> require 'java'
=> false
[2] pry(main)> puts RUBY_PLATFORM; puts RUBY_VERSION
java
1.9.3
=> nil
[3] pry(main)> java_import 'javax.script.ScriptEngineManager'
=> [Java::JavaxScript::ScriptEngineManager]
[4] pry(main)> engine = ScriptEngineManager.new.get_engine_by_name('nashorn')
@jeregrine
jeregrine / Howto.md
Created May 12, 2015
Setting up Redo and Poolboy for redis connections in Elixir
View Howto.md

Then add

worker(Redis, []),

to your supervision tree

View Gemfile
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@dgraham
dgraham / fetch.js
Last active Aug 31, 2021
Simple window.fetch wrapper.
View fetch.js
(function() {
function status(response) {
if (response.ok) {
return response
} else {
var error = new Error(response.statusText || response.status)
error.response = response
throw error
}
}
@Liryna
Liryna / ARMDebianUbuntu.md
Last active Oct 4, 2021
Emulating ARM on Debian/Ubuntu
View ARMDebianUbuntu.md

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

View lol.exs
defmodule Fun do
def arity(fun) do
case :erlang.fun_info(fun, :arity) do
{ :arity, arity } ->
arity
end
end
def adapt!(fun, 0) do
fn -> fun.([]) end
@courtneyfaulkner
courtneyfaulkner / devices.c
Created Dec 11, 2013
List OpenCL platforms and devices
View devices.c
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {
View algebra.cljx
(ns paddleguru.algebra
"Shared algebras for cljs and clj.")
(defprotocol Semigroup
(plus [l r]))
;; Shared extensions
(extend-protocol Semigroup
nil
(plus [l r] r))
View maybe.rb
# Consider the option type Maybe(a), representing a value that is either a single value of type a, or no value at all.
# To distinguish these, we have two algebraic data type constructors: Just(x), containing the value x, or Nothing,
# containing no value.
#
# data Maybe(t) = Just(t) | Nothing
#
# We would like to be able to use this type as a simple sort of checked exception: at any point in a computation,
# the computation may fail, which causes the rest of the computation to be skipped and the final result to be Nothing.
# If all steps of the calculation succeed, the final result is Just(x) for some value x.