Skip to content

Instantly share code, notes, and snippets.

View alekzonder's full-sized avatar
🦊

alekzonder alekzonder

🦊
View GitHub Profile
@u-ndefine
u-ndefine / 50_lines.pde
Last active June 13, 2024 08:03
Sketch of my generative art, "50 Lines"
float decel(float x) { // as an easing function
return 1-(x-1)*(x-1);
}
void setup() {
background(255);
size(750,750,P2D);
PImage img = loadImage("image.png");
strokeWeight(2);
noFill();
@delikat
delikat / next.config.js
Last active August 4, 2021 03:39
Modular antd imports with next.js, next-less, next-typescript, and babel-plugin-import
const withLess = require('@zeit/next-less')
const withTypescript = require('@zeit/next-typescript')
const resolve = require('resolve')
module.exports = withTypescript(withLess({
lessLoaderOptions: {
javascriptEnabled: true,
// theme antd here
modifyVars: {'@primary-color': '#1Dd57A'}
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active April 25, 2024 17:43
Ansible variable precedence (order, hierarchy)
SELECT AVG(t1.`value`) AS median_val FROM (
SELECT @rownum:=@rownum+1 AS `row_number`, d.`value`
FROM `data` d, (SELECT @rownum:=0) r
WHERE 1 -- use self where
ORDER BY d.`value`
) AS t1,
(
SELECT count(*) AS total_rows
FROM `data` d
WHERE 1 -- use self where
@Sibirtsev
Sibirtsev / output
Last active June 14, 2016 02:57
Interpolation matrix of numbers with mean values
$ php scale.php
[5 x 5]
13.00 11.00 13.00 15.00 10.00
12.00 10.00 15.00 11.00 13.00
10.00 15.00 10.00 12.00 14.00
15.00 11.00 13.00 11.00 14.00
15.00 13.00 15.00 12.00 0.00
@simongong
simongong / camelSnake.js
Created May 10, 2016 06:40
JavaScript: convert format of object keys between camel-case and snake-case
/**
* @param {Object|String} data string or keys of object are named in form of snake
* @param {number} depth to which level of keys should it process
* @return {Object|String} string or keys of object are named in form of camel case
*/
exports.snakeToCamel = function(data, depth) {
if (Util.isObject(data)) {
if (typeof depth === 'undefined') {
depth = 1;
}
@gungorbudak
gungorbudak / mannwhitneyu.js
Last active October 17, 2023 16:24
Mann Whitney U test Javascript implementation
'use strict';
(function(exports) {
var rank = {
/*
* Standart ranking
*
* The MIT License, Copyright (c) 2014 Ben Magyar
*/
@ocornut
ocornut / (Archived) imgui_memory_editor.h
Last active January 1, 2024 04:27
Mini memory editor for dear imgui (to embed in your game/tools)
// Mini memory editor for Dear ImGui (to embed in your game/tools)
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112
// THE MEMORY EDITOR CODE HAS MOVED TO GIT:
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor
// Click "Revisions" on the Gist to see old version.
@ythecombinator
ythecombinator / add_disqus_hexo.md
Created May 27, 2015 23:59
Simple tip for adding "Disqus" comments for Hexo.

In the footer of your theme (something like footer.ejs) you should add Disqus script:

<% if (config.disqus_shortname){ %>
<script>
  var disqus_shortname = '<%= config.disqus_shortname %>';
  <% if (page.permalink){ %>
  var disqus_url = '<%= config.url +"/"+ page.path %>';
  <% } %>
 (function(){
@yunano
yunano / consul.service
Created May 1, 2015 15:52
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d