Skip to content

Instantly share code, notes, and snippets.

View ZakharDay's full-sized avatar

ZakharDay ZakharDay

View GitHub Profile
@fillmember
fillmember / useful-figma-scripts.md
Last active February 24, 2025 14:31
Useful Figma scripts

Useful Figma Scripts

These are some scripts that can help automate operations within Figma.

image

To use them, focus Figma and open up the Developer Tools panel by using the shortcut key Command + Option + I. Switch to Console tab and click on the last line of the white text area to input text. You are now ready to copy-paste scripts into Figma.

Disclaimer: Not liable for data loss or misoperations. Use at your own risk.

@davidteren
davidteren / Rails, Puma & Nginx.md
Last active January 16, 2025 21:19
Example setup for Puma with Nginx in a Rails app

In the apps config/puma.rb file:

Change to match your CPU core count
# Check using this on the server => grep -c processor /proc/cpuinfo
workers 4

# Min and Max threads per worker
threads 1, 6

app_dir = File.expand_path('../..', FILE)

@yokotaso
yokotaso / webpack.config.js
Last active August 26, 2022 05:26
webpack.config.js with babel, polyfill
const path = require('path');
module.exports = {
mode: "development",
entry: {
'polyfill': '@babel/polyfill',
'kintone-create-edit-show': './src/kintone-create-edit-show.js'
},
module: {
rules: [
<html lang=en>
<head>
<meta charset=utf-8>
<title>Javascript gravity</title>
</head>
<body onload="init()">
<script>
var canvas, ctx, container;
@ahmedmusawir
ahmedmusawir / gist:b79a6faf54205ef9e2305ef014de0bd8
Created February 19, 2018 01:01
SHOPIFY BUY BTN ONLY WITHOUT IFRAME
<h1 class="text-center">Single Shopify Product BUTTON ONLY</h1>
<h3>
Product is coming from Rico's store - Nuva Organics
</h3>
<script src="https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js" type="text/javascript"></script>
<script type="text/javascript">
var client = ShopifyBuy.buildClient({
@sibsfinx
sibsfinx / prepare_hd.sh
Last active February 12, 2018 00:54
Prepare external drive on mac fucking OS
# list disks:
diskutil list
# use disk name from the listed isntead of disk3
# unmount your external drive:
diskutil unmountDisk force disk3
# format in HFS with the name you want:
diskutil partitionDisk disk3 GPT JHFS+ "Drive Name" 0g
@schweigert
schweigert / Embedding GoLang into a Ruby application.md
Last active April 11, 2025 19:24
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@ryanbaumann
ryanbaumann / index.html
Last active February 3, 2023 08:05
Example of loading large geojson into Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
@ZhihaoLau
ZhihaoLau / times.js
Created October 14, 2016 02:42
‘Ruby times method’ in JavaScript
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install