Skip to content

Instantly share code, notes, and snippets.

View eexit's full-sized avatar
🚀

Joris Berthelot eexit

🚀
View GitHub Profile
@ErisDS
ErisDS / examples.md
Last active January 14, 2025 22:52
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@jctebbal
jctebbal / Resilient_listener
Created September 18, 2014 11:58
Consume RabbitMQ cluster messages behind a load balancer using Pecl AMQP
<?php
/**
when using a RabbitMQ cluster we usually access it via a load balancer (in this case Amazon ELB).
Load balancers allow a maximum idle time to the connections they manage,
this is seen from a client as a connection drop. This script shows how to ignore these drops but
is still able to deal with an actual connectivity problem.
*/
define ( 'MINIMUM_LIFE', 30); //needs to be lower than the load balancer timeout
$last_connection = 0;
@zmwangx
zmwangx / Use custom script with xargs.md
Last active October 12, 2021 08:33
Explains how to use custom script with xargs without eating up all arguments in the first call.

To use xargs with custom script that takes in a fixed number of arguments, we need to use the replacement feature of xargs. For instance, given a script that indends to take one argument, e.g.

$ cat awesome.sh                                                      
#!/bin/zsh
is_awesome=' is awesome!'
awesome_sentence=$1$is_awesome
echo $awesome_sentence

A naive xargs call

@Integralist
Integralist / GitHub curl.sh
Last active February 6, 2025 20:47 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@viktorklang
viktorklang / §(Toggle Wi-Fi).app
Last active December 5, 2024 03:25
AppleScript to toggle Wi-Fi in OSX
(*
Installation instructions
=========================
Run as an Application:
1) Open AppleScript Editor and create a new script
2) Paste this file into it
3) Save name it '§(Toggle Wi-Fi)'
- Or substitute '§' for a symbol that you can press with a single key
4) Put it in Applications/Utilities
@woods
woods / gen-key-script
Last active October 31, 2024 23:23
Creating gpg keys non-interactively
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: [email protected]
Expire-Date: 0
@crazed
crazed / gist:7670423
Last active September 7, 2023 22:20
getting a moto x back to stock on mac os x
  1. grab the moto-fastboot version of fastboot here

  2. grab the appropriate stock firmware here (tip: you want the one that matches your android build number in settings -> about phone)

  3. unzip this file somewhere and make it easy to run the moto-fastboot-osx64 command from step 1

  4. get your phone into fastboot mode, google it if needed but just power the phone off, hold the down volume key and power button for 3 seconds then let go, should get you there

  5. verify you are ready for flashing:

     ./moto-fastboot-osx64 devices
     -- should list a device --
    
  6. most of the time you just need to flash system and recovery images, so from your unzipped stock firmware files do this:

@theotherian
theotherian / Toggling Wifi via Applescript
Last active November 21, 2024 00:08
An AppleScript for toggling wifi on and off
A script for turning wifi on and off on a Mac
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: