Skip to content

Instantly share code, notes, and snippets.

View Jacobinoo's full-sized avatar
🎯
Focusing

Jacobinoo

🎯
Focusing
View GitHub Profile
@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 ] }
@nguyenanhtu
nguyenanhtu / SSLXampp.md
Last active March 1, 2026 23:47
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
@troyfontaine
troyfontaine / 1-setup.md
Last active September 4, 2026 12:31
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@Mo45
Mo45 / discord.msg.send.php
Last active June 2, 2026 03:43
PHP - Send message to Discord via Webhook
<?php
/**
* discord.msg.send.php v0.8
* Kirill Krasin &copy; 2025
* https://github.com/Mo45
*
* For revisions and comments vist: https://gist.github.com/Mo45/cb0813cb8a6ebcd6524f6a36d4f8862c
*
* Sends a message to Discord via Webhook with file support and rate limit handling
*
@OkoyaUsman
OkoyaUsman / 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:
@Jengas
Jengas / index.php
Last active May 4, 2026 12:07
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');
@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: