Skip to content

Instantly share code, notes, and snippets.

@jareware
jareware / SCSS.md
Last active April 23, 2024 22:13
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@tmcw
tmcw / xyz_vs_tms.md
Last active April 3, 2024 06:18
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

apply plugin: 'java'
apply plugin: 'maven-publish'
repositories { jcenter() }
dependencies { compile 'org.slf4j:slf4j-api:1.7.12' }
publishing {
repositories {
maven {
url "http://127.0.0.1:8081/artifactory/libs-release-local/"
@jiaaro
jiaaro / _INSTRUCTIONS.md
Last active January 22, 2024 17:47
Using Swift libraries in Python

Using Swift libraries in Python

So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?

But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?

Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.

How to get Python code calling Swift functions:

@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active April 17, 2024 18:56
Vanilla JavaScript Quick Reference / Cheatsheet

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@bvolpato
bvolpato / ba.sh
Last active February 6, 2024 09:00
Install Chrome Driver with Xvfb (Ubuntu Server)
#!/bin/bash
# Chrome Repo
sudo apt-get install fonts-liberation xdg-utils libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt-get update
# Download
@ugiacoman
ugiacoman / Client-Loading-Example.md
Last active June 24, 2022 20:50
SSR + CSR using next.js

Whether your component relies on client-side features or you are using 3rd party components that are not designed for server-side rendering, sometimes you'll want to defer rendering until on the client. For our example, we'll be using react-chart-2 to load a Doughnut chart.

Doughnut

You'll need a next project and to install chart.js + react-chartjs-2.

$ npm install --save chart.js react-chartjs-2  
@outofcoffee
outofcoffee / gradle-kotlin-publish-s3-maven-repo.gradle
Last active March 4, 2019 11:40
Publish a Kotlin module to an S3 Maven repository, using Gradle.
/*
* Publish a Kotlin module to an S3 Maven repository, using Gradle.
* This assumes that the AWS/IAM credentials have 'bucket list' as well as 'object put' and 'object get' permissions.
*/
ext.version_kotlin = '1.0.5-2'
buildscript {
repositories {
mavenCentral()