Skip to content

Instantly share code, notes, and snippets.

View jtojnar's full-sized avatar
💤

Jan Tojnar jtojnar

💤
  • ogion.cz
  • Czech Republic
View GitHub Profile
# Created by @PhilippIRL
# This script patches Spotify's offline.bnk file (this file caches the remote config) to trick Spotify into thinking that your account is enabled for dev tools.
# Spotify will automatically revert this local change after some time when it next fetches the remote config.
# Of course you will have to completely close Spotify before running this script.
import os, sys, platform
systemPlatform = platform.system()
if systemPlatform == 'Windows':
@graninas
graninas / On_hiring_haskellers.md
Last active March 25, 2023 16:49
On hiring Haskellers

On hiring Haskellers

Recently I noticed the number of the same two questions being asked again and again on different Haskell resources. The questions were “How to get a Haskell job” and “Why is it so hard to find Haskellers?” Although these two are coming from the opposite sides of the hiring process, the answer is really just one. There is a single reason, a single core problem that causes difficulties of hiring and being hired in the Haskell community, and we should clearly articulate this problem if we want to increase the Haskell adoption.

We all know that there are many people wishing to get a Haskell job. And a visible increase of Haskell jobs looks like there should be a high demand for Haskellers. The Haskell community has also grown like crazy past years. But still, why is it so difficult to hire and to be hired? Why can’t companies just hire any single person who demonstrates a deep knowledge of Haskell in blog posts, in chats, on forums, and in talks? And why do Haskell companies avoid hirin

@joepie91
joepie91 / .md
Last active June 25, 2023 02:07
Please don't include minified builds in your npm packages!

Please don't include minified builds in your npm packages!

There's quite a few libraries on npm that not only include the regular build in their package, but also a minified build. While this may seem like a helpful addition to make the package more complete, it actually poses a real problem: it becomes very difficult to audit these libraries.

The problem

You've probably seen incidents like the event-stream incident, where a library was compromised in some way by an attacker. This sort of thing, also known as a "supply-chain attack", is starting to become more and more common - and it's something that developers need to protect themselves against.

One effective way to do so, is by auditing dependencies. Having at least a cursory look through every dependency in your dependency tree, to ensure that there's nothing sketchy in there. While it isn't going to be 100% perfect, it will detect most of these attacks - and no

@snoyberg
snoyberg / upper-bounds.md
Created May 27, 2016 03:13
Michael Snoyman's personal take on PVP version upper bounds

In response to a request on Reddit, I'm writing up my thoughts on PVP upper bounds. I'm putting this in a Gist since I don't want to start yet another debate on the matter, just provide some information to someone who asked for it. Please don't turn this into a flame war :)

For those unaware: the Package Versioning Policy is a set of recommendations covering how to give version numbers to your packages, and how to set upper and lower bounds on your dependencies.

I'll start by saying: I support completely with the PVP's recommendations on how to assign version numbers. While there are plenty of points in this design space, the PVP is an unobjectionable one, and consistency in the community is good. On multiple occasions, I have reached out to package authors to encourage compliance with this. (However, I've always done so privately, as opposed to a statement on Reddit, as I believe that to be a more likely route to successful convincing.)

The issue aro

{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Main(main) where
import GHC.Exts ( addrToAny# )
import GHC.Ptr ( Ptr(..) )
import System.Info ( os, arch )
import Encoding
import ObjLink
main :: IO ()
@martijnvermaat
martijnvermaat / nixos.md
Last active March 24, 2024 11:42
Installation of NixOS with encrypted root
@jeffbr13
jeffbr13 / wikipedia-subheading-links.js
Created April 28, 2014 23:56
Greasemonkey script to add link anchors to Wikipedia page subheadings
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.
@bmcbride
bmcbride / geojson-length.py
Created March 31, 2014 20:41
Calculate the length of a GeoJSON linestring using the Python GDAL/OGR API
from osgeo import ogr
from osgeo import osr
source = osr.SpatialReference()
source.ImportFromEPSG(4326)
target = osr.SpatialReference()
target.ImportFromEPSG(3857)
transform = osr.CoordinateTransformation(source, target)
@helloitszak
helloitszak / quick_ed2k.rb
Last active August 1, 2016 20:11
This quickly gets ed2k links for anidb crequing.
#!/usr/bin/env ruby
require 'openssl'
if ARGV.length == 0
puts "This quickly gets ed2k links for anidb crequing."
puts "Usage: #{$0} [files]"
exit
end
def ed2k(file_name)