Skip to content

Instantly share code, notes, and snippets.

View Jacobinoo's full-sized avatar

Jakub Banasiewicz Jacobinoo

View GitHub Profile
@Jacobinoo
Jacobinoo / LibSignal_on_macOS.md
Last active November 3, 2024 20:51
Make LibSignal work on macOS

LibSignal is not officially supported on macOS because it's not one of Signal's app platforms (Signal Mac app uses Electron). You'll have to build the Rust parts yourself instead of using the prebuilt ones.

  1. Check out https://github.com/signalapp/libsignal repo.
  2. Have Rust as well as clang, libclang-dev, cmake, make, protobuf-compiler, git installed, or set it up using bin/mac_setup.sh.
  3. Build the checked out repo using swift/build_ffi.sh --release.
  4. nano *.podspec
  5. Add s.osx.deployment_target = '10.15' after s.swift_version = '5' in Podspec file.
  6. pod lib lint --platforms=macos
  7. In your project's Podfile:
@Jacobinoo
Jacobinoo / workflow.md
Last active May 27, 2023 14:11
Versioning and Git Workflow

Semantic Versioning

Details:

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

@Jengas
Jengas / index.php
Last active October 30, 2024 06:26
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');
@mokoshalb
mokoshalb / imgtransfer.php
Created January 4, 2018 12:10
3 ways to download and save a remote image on your server using PHP
<?php
/*
In this tutorial I am going to show you some PHP Methods By which you can easily download remote server image on your local server.
Suppose you don't have FTP access of images but you are able to access images via http port and you want to perform bulk image download.
Then these methods are very useful and you can try any of them to download and save a remote images on your server folder.
*/
// Method-1: By using simple copy() function in PHP
copy("REMOTE SERVER IMAGE URL", 'LOCAL SERVER PATH');
// ie:
@Mo45
Mo45 / discord.msg.send.php
Last active September 2, 2024 14:57
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
@nguyenanhtu
nguyenanhtu / SSLXampp.md
Last active July 12, 2024 19:06
Guide to configure SSL in XAMPP for Windows

How to test 'https' in XAMPP for localhost ? I will guide you

Menu

  • Create certificate
  • Config Apache to access https instead of http
  • Config mod rewrite to generate SSL url
  • Config Virtual host to test site

Step 1 : Create certificate

  • Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
@levicook
levicook / gist:4132037
Created November 22, 2012 16:37
modeling friends and calculating mutual friends w/ mongodb
// ------------------------------------------------------------------
// Friend collection, where _id is a user.Id and Friends is a list, of user.Id.
// Note: friending and unfriending is a two step operation in this scheme:
> db.friends.find()
{ "_id" : 1, "friends" : [ 2, 3, 4 ] }
{ "_id" : 2, "friends" : [ 1, 3, 5 ] }
{ "_id" : 3, "friends" : [ 1, 2, 4, 5 ] }
{ "_id" : 4, "friends" : [ 1, 3, 5 ] }
{ "_id" : 5, "friends" : [ 2, 3, 4 ] }