Skip to content

Instantly share code, notes, and snippets.

View skvggor's full-sized avatar
📚
Rust saga 🛩️

Marcos Lima skvggor

📚
Rust saga 🛩️
View GitHub Profile
@mfd
mfd / ImageMagick_snippets.md
Last active March 20, 2018 18:44
ImageMagick sprite image snippets

imagemagick sprite

convert $(ls *.png | sort -r) +append res/result-sprite-vertical.png
convert $(ls *.png) -append res/result-sprite-horizontal.png
convert *png *gif -append PNG8:res/result-sprite-horizon.png

imagemagick Montage #

montage *.png -background transparent -geometry +4+4  res/sprite.png
montage $(ls *.png -t) -mode Concatenate -tile 2x16+1+1 -border 2 res/sprite.png
// const input = `4
// 1 4 3 2`
// input.split('\n')[1].split(' ').reverse().join(' ')
// Sample Input
// const input = `1 1 1 0 0 0
// 0 1 0 0 0 0
xterm*background: grey9
xterm*foreground: white
xterm*cursorColor: red
xterm*cursorUnderline: true
xterm*cursorBlink: true
xterm*saveLines: 100
! -- Allow utf8 in/out
xterm*utf8: 2
xterm*eightBitInput: true
xtere*eightBitControl: false
@atelierbram
atelierbram / set-active-class-in-nunjucks.md
Last active February 26, 2022 05:37
Set Active Class on Nav-Menu-Item in Nunjucks

In html/about/index.html:

{% extends "layouts/layout.njk" %}

{% set base_path = "../../" %}
{% set page_title = "about" %} 

In data.json:

@wiledal
wiledal / template-literals-3-for-loops.js
Last active March 13, 2023 22:47
Template Literals example: For loops
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `
# Android SDK setup
## Install Java
```bash
sudo apt-get update
sudo dpkg --add-architecture i386
sudo apt-get install libbz2-1.0:i386
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
sudo apt-get install openjdk-8-jdk openjdk-8-jre
@ivan-kalachikov
ivan-kalachikov / opengraph.html
Last active August 8, 2018 21:03
open graph
<meta property="og:title" content="The Attorney" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://ivankalachikov.esy.es/ahblaw/attorney.html" />
<meta property="og:description"
content="Sharis is a native Texan who was born in Houston and has committed herself to helping other Texans in need. Sharis attended Baylor University and obtained both her undergraduate and law degree in Waco and moved to Dallas to begin her law practice." />
<meta property="og:image" content="http://ivankalachikov.esy.es/ahblaw/images/5.jpg" />
<meta property="og:image:width" content="323" />
<meta property="og:image:height" content="492" />
@josh-padnick
josh-padnick / fish-agent.sh
Last active May 24, 2024 09:09
Run ssh-agent via fish shell
#!/bin/bash
#
# Convert ssh-agent output to fish shell
#
eval "$(ssh-agent)" >/dev/null
echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK"
echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID"
@mpj
mpj / monad-stream-example.js
Last active September 14, 2022 06:42
This is the code from Monads - episode #21 of FunFunFunction (https://www.youtube.com/playlist?list=PL0zVEGEvSaeFSwPn06GKArptSxiP1Gff8)
const fetch = require('node-fetch')
const Bacon = require('baconjs')
function getInPortuguese(word) {
// Google Translate API is a paid (but dirt cheap) service. This is my key
// and will be disabled by the time the video is out. To generate your own,
// go here: https://cloud.google.com/translate/v2/getting_started
const apiKey =
'AIzaSyB4DyRHIsNhogQXmH16YKbZfR-lTXrQpq0'
const url =
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js