Skip to content

Instantly share code, notes, and snippets.

View nelsonvassalo's full-sized avatar
🎯
Focusing

Nelson Vassalo nelsonvassalo

🎯
Focusing
View GitHub Profile
@georgy7
georgy7 / extract_mbox_attachments.py
Last active March 22, 2025 13:11
Extract attachments from mbox file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# https://web.archive.org/web/20150312172727/http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"

Templating engines and React.js

I want to make a shopify theme using react.

How shopify theming works

You have a bunch of template files that have access to global server-side variables with liquid e.g. {{ product.title }}. Think wordpress or any other theme-based system.

 /theme
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 9, 2025 03:22
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@fazlurr
fazlurr / canvas-upload.php
Created March 27, 2014 07:20 — forked from xjamundx/canvas-upload.php
Function to save base64 image to png with PHP
<?php
// requires php5
define('UPLOAD_DIR', 'images/');
$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.png';
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save the file.';
@MontyThibault
MontyThibault / example.js
Last active October 9, 2022 10:45
Simplified Octree/Quadtree Partitioning in THREE.js
// Create the tree
var box = new THREE.Box3(new THREE.Vector3(-25, -25, -25), new THREE.Vector3(25, 25, 25));
var tree = new Octree(box, {
maxDepth: 10,
splitThreshold: 5,
joinThreshold: 3
});
scene.add(tree);
// Add children the same way you would any other regular object.
@ze-
ze- / invert_brightness.css
Created May 7, 2012 05:00
Hue-preserving Brightness-Inversion Filter-Effects Userstyles for Firefox
@namespace url(http://www.w3.org/1999/xhtml);
/* this filter can cause bizarre breakage on some pages,
sometimes mild but sometimes a severe smearing into fuzzy lines!?
it also fails to affect background colors or images for some reason. */
@-moz-document url-prefix(http://), url-prefix(ftp://), url-prefix(file://), url-prefix(https://), url("about:blank") {
body {
/* this can crudely work-around the inability to affect backgrounds, but can cause breakage */
background-color:black !important;