Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

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",
@peterpme
peterpme / index.js
Last active July 8, 2023 19:09
Cloudflare Workers + Expo Webhook + Slack Notification. Update SLACK_WEBHOOK_URL & paste this in the worker file
const SLACK_WEBHOOK_URL = "https://hooks.slack.com/services/XXX/YYY/ZZZZZ";
async function sendSlackRequest({ text, blocks }) {
const postToSlack = await fetch(SLACK_WEBHOOK_URL, {
body: JSON.stringify({ text, blocks }),
method: "POST",
headers: { "Content-Type": "application/json" },
});
}
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
GoRouter.setUrlPathStrategy(UrlPathStrategy.path);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@GeneralSadaf
GeneralSadaf / List of Discord voice activities.md
Last active June 20, 2024 15:45
IDs of Discord voice activities.

Activities no longer require boosts to unlock. Activities except Watch Together are locked behind Nitro. Kept boost levels for prosperity.

Stable versions

Application ID Application name Boost level Max participants
755600276941176913 YouTube Together(Old) 0 Unlimited
880218394199220334 Watch Together(New) 0 Unlimited
755827207812677713 Poker Night 1 25
773336526917861400 Betrayal.io 0 Unlimited
814288819477020702 Fishington.io 0 Unlimited
832012774040141894 Chess In The Park 1 Unlimited

ogp

Mix.install([
  {:kino, "~> 0.6.1"},
  {:ogp, "~> 1.0"}
])
@weissi
weissi / Makefile
Last active January 9, 2022 09:57
dont free
CFLAGS := -O2 -fPIC
test: libdontfree.dylib test.swift
swiftc -L. -ldontfree test.swift
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
libdontfree.dylib: dont-free.o
$(CC) $(LDFLAGS) -shared -o $@ $^
import 'package:flutter_test/flutter_test.dart';
import 'package:intl/intl.dart';
import 'package:timezone/timezone.dart';
import 'package:timezone/data/latest.dart';
// A DateTime in dart contains the TimezoneOffset from UTC/GMT
// However formatting a Date using timezone patterns/symbols like "Z" or "Z"
// is not supported yet.
// See: https://github.com/dart-lang/intl/issues/19 for more details.
Future<void> main() async {
name: Elixir CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MIX_ENV: test
@lukas-h
lukas-h / formatRfc822.dart
Last active April 23, 2024 05:47
Dart DateTime DateFormat to RFC-822 String
import 'package:intl/intl.dart';
import 'package:test/test.dart';
formatRfc822(DateTime d) {
var template = "EEE, dd MMM yyyy HH:mm:ss";
var out = DateFormat(template).format(d);
if (d.isUtc) {
out += ' GMT';
} else {
var offset = d.toLocal().timeZoneOffset.inHours * 100;
/// |                    World                 |
/// |------------------------------------------|
/// | Module A | Module B | Module C | Module D|
  1. World is a module
  2. World is aware of all modules.
  3. Modules aren't aware of World.