Skip to content

Instantly share code, notes, and snippets.

View zsiciarz's full-sized avatar

Zbigniew Siciarz zsiciarz

View GitHub Profile
@radiantly
radiantly / noMangleGoogle.user.js
Last active December 28, 2023 04:31
Prevent Google from mangling links on the search results when clicking or copying on Firefox
// ==UserScript==
// @name Prevent link mangling on Google
// @namespace LordBusiness.LMG
// @match https://www.google.com/search
// @grant none
// @version 1.1
// @author radiantly
// @description Prevent google from mangling the link when copying or clicking the link on Firefox
// ==/UserScript==
#![feature(lang_items)]
#![no_std]
#[no_mangle]
pub fn add_one(x: i32) -> i32 {
x + 1
}
// needed for no_std
@jleclanche
jleclanche / get_or_create.py
Created July 7, 2017 09:57
SQLAlchemy get or create
def get_or_create(session, model, defaults=None, **kwargs):
"""
Get or create a model instance while preserving integrity.
"""
try:
return session.query(model).filter_by(**kwargs).one(), False
except NoResultFound:
if defaults is not None:
kwargs.update(defaults)
-- inspired by: https://groups.google.com/d/msg/elm-discuss/2LxEUVe0UBo/ZgJ_ldUH6ygJ
-- thanks for the help: http://learnyouahaskell.com/functors-applicative-functors-and-monoids
module UserDecoder where
import Date exposing (Date)
import User exposing (User)
import Json.Decode as Js exposing ((:=))
-- Applicative's `pure`:
@mathiasbynens
mathiasbynens / README.md
Last active August 5, 2023 03:20
Superfish certificate
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

Small bag / wearing

  • Passport (+I-797B)
  • Hoodie
  • Bluetooth headphones
  • Surface
  • 3DS/Vita (+games for 3DS)
  • Nexus 9
  • Kindle
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active June 8, 2020 03:24
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
$ rustc --crate-type dylib rusty.rs
$ python rusty.py
5