Skip to content

Instantly share code, notes, and snippets.

View krukid's full-sized avatar

Viktors Buls krukid

  • Juro
  • Riga, Latvia
View GitHub Profile
@krukid
krukid / NOTES
Last active August 13, 2020 21:57
mint-object-explorer
potentially useful features/ tweaks:
1. persistent node toggle across searches
2. node toggles expand AND highlight (alt color?)
3. opacity darken bg for nested containers
4. search expressions (key="foo" value=2 AND value=5)
// key is exactly "foo" OR value contains both 2 and 5
@krukid
krukid / components.mint-toast-item.js
Last active September 26, 2019 00:07
mint-toast-v2
import Component from '@ember/component';
import { computed } from '@ember/object';
import { later, next } from '@ember/runloop';
import $ from 'jquery';
const TEMP_DELAY = 3000;
const SLIDE_DELAY = 300;
const FADE_IN_DELAY = SLIDE_DELAY * 1.3;
const FADE_OUT_DELAY = SLIDE_DELAY * 0.7;
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@saippuakauppias
saippuakauppias / share.js
Created September 1, 2015 10:43
Share text or link in vk (vkontakte, vk.com), fb (facebook, facebook.com), tw (twitter, twitter.com)
/********************************************************************
*
* Share social http://habrahabr.ru/post/156185/
*
*********************************************************************/
function Share(purl, ptitle, pimg, text) {
'use strict';
this.purl = purl;
this.ptitle = ptitle;
@fogleman
fogleman / words.md
Last active February 20, 2025 17:00
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is
@hullen
hullen / mobileCheck.js
Last active January 4, 2025 09:00
Detects mobile devices: phones, tablets. mobileCheck is a lightweight Javascript utils for detecting mobile devices and tablets. Its using User Agent string. Usage: if ( mobileCheck.smarphone ) { // Code }
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}()),
android: (function(){
return navigator.userAgent.match(/Android/i);
}()),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}()),
@maxim
maxim / rails_load_path_tips.md
Last active January 9, 2025 00:59
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@rriemann
rriemann / create_gif.sh
Created April 17, 2013 14:33
Create an animated gif using ffmpeg, convert (imagemagick) and gifsicle
#!/usr/bin/env sh
rm out*.jpg
rm out*.gif
ffmpeg -y -i 13040065.mp4 -t 1 -filter:v transpose=1,scale=400:-1,deshake,crop=400:400 out%02d.jpg
for file in *.jpg; do
convert $file ${file%.*}.gif
done
gifsicle --delay=5 --colors 256 --loop out*.gif > final.gif
@mjackson
mjackson / color-conversion-algorithms.js
Last active April 1, 2025 17:53
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@s-andringa
s-andringa / Locales.yml
Created September 19, 2012 10:09
Amsrb talk 18 sept - exceptions_app in Rails 3.2
# config/locales/en.yml
en:
exception:
show:
not_found:
title: "Not Found"
description: "The page you were looking for does not exists."
internal_server_error:
title: "Internal Server Error"