Skip to content

Instantly share code, notes, and snippets.

View cappert's full-sized avatar

Camille Appert cappert

View GitHub Profile
@DUznanski
DUznanski / faction_list.py
Created July 13, 2018 17:26
Magic the Gathering faction list generator
def check_faction_set_validity(factions):
# count the number of on bits in each position for our list of faction IDs. If they're all the same, then the faction list is valid.
return factions and len({sum((faction >> k) & 1 for faction in factions) for k in range(5)}) == 1
def faction_string(faction):
return ''.join('WUBRG'[i] for i in range(5) if (faction >> i) & 1)
def faction_list_string(factions):
return ','.join(faction_string(faction) for faction in factions)
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active July 3, 2025 21:22
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

@iosecure
iosecure / iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment.md
Last active November 6, 2025 02:51
iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

This post by a security researcher who prefers to remain anonymous will elucidate concerns about certain problematic decisions Apple has made and caution about future decisions made in the name of “security” while potentially hiding questionable motives. The content of this article represents only the opinion of the researcher. The researcher apologises if any content is seen to be inaccurate, and is open to comments or questions through PGP-encrypted mail.



TL;DR

@chrismccord
chrismccord / upgrade.md
Last active September 5, 2025 05:27
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@emorima
emorima / sum_all_rg_evnets.rb
Created October 22, 2016 16:32
RailsGirlsTools
require 'yaml'
PAGE_PATH = "./railsgirls/events.html"
class Event
def initialize(new_line)
@lines = [ new_line ]
@country = nil
@city = nil
@date = nil
@jesstelford
jesstelford / Links in markdown.md
Last active June 6, 2022 13:56
Putting links in code blocks on GitHub
Cara Caracal 48 km
RAPID Caracal 8 784 m
1호 Caracal 7 897 m
~m^_^m~ Ares 6 954 m
타이거 카라칼 랩라독 Caracal 6 869 m
l Caracal 6 867 m
Green and mean Caracal 6 807 m
THE 랩라카라칼 Caracal 6 654 m
Sculy Scythe 6 492 m
CERB RLML Cerberus Cerberus 6 383 m
<!--
In Vue, we use v-model for all form bindings, while
Knockout maintains separate binding types, such as
textInput, checked, and options. In some cases,
such as for an input of type "range", Knockout
simply doesn't have an equivalent two-way binding
helper and the more verbose value and valueUpdate
must be used.
-->
<div id="app">