Skip to content

Instantly share code, notes, and snippets.

View Anonyfox's full-sized avatar
🦀
Gopher, Rustacean & Alchemist

Maximilian Stroh Anonyfox

🦀
Gopher, Rustacean & Alchemist
View GitHub Profile
@Anonyfox
Anonyfox / salesforce.exs
Created August 12, 2023 09:26
Call Salesforce Rest API with Elixir
# inspiration/guide: https://developer.sage.com/api/financials/how-to/configure-authentication/
defmodule Salesforce do
@user_email "XXX"
@user_password "XXX"
@client_id "XXX"
@client_secret "XXX"
def get_credentials() do
response = HTTPoison.post!(
"https://login.salesforce.com/services/oauth2/token",
@raysegantii
raysegantii / README.md
Last active June 3, 2020 21:24 — forked from scrogson/README
Use bootstrap-sass npm package with Phoenix's brunch
  1. install npm packages
  2. update brunch-config.js
  3. rename web/static/css/app.css to web/static/css/app.scss
  4. update web/static/css/app.scss
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@ohanhi
ohanhi / joy-of-composition.md
Last active February 3, 2021 18:14
The Joy of Composition - Why stateless rendering is pure bliss

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views

@miku
miku / ngram.go
Last active February 13, 2021 23:23
Handbaked N-Gram string similarity in Golang.
package main
import "fmt"
import "github.com/juju/utils/set"
func jaccard(a, b set.Strings) float64 {
return float64(a.Intersection(b).Size()) / float64(a.Union(b).Size())
}
func ngrams(s string, n int) set.Strings {
@stbaer
stbaer / tinytest.api
Last active November 15, 2016 19:10
Meteor tinytest api
test.isFalse(v, msg)
test.isTrue(v, msg)
test.equal(actual, expected, message, not)
test.length(obj, len)
test.include(s, v)
test.isNaN(v, msg)
test.isUndefined(v, msg)
test.isNotNull
test.isNull
test.throws(func)
generateUniqueID = () ->
_p8 = (s) ->
p = (Math.random().toString(16)+"000000000").substr(2,8)
if s then "-" + p.substr(0,4) + "-" + p.substr(4,4) else p
_p8() + _p8(true) + _p8(true) + _p8()
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@grancalavera
grancalavera / unicorn.sublime-snippet
Created June 4, 2013 13:26
Unicorn Sublime Text snippet ^.^
<snippet>
<content><![CDATA[
console.log(" /");
console.log(" .7");
console.log(" \\\ , //");
console.log(" |\\\.--._/|//");
console.log(" /\\\ ) ) ).'/");
console.log(" /( \\\ // /");
console.log(" /( J`((_/ \\\");
console.log(" / ) | _\\\ /");
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google