Skip to content

Instantly share code, notes, and snippets.

View jonobr1's full-sized avatar
🐌
Petit à petit ça avance

Jono jonobr1

🐌
Petit à petit ça avance
View GitHub Profile
@TimTinkers
TimTinkers / Fee1155NFTLockable.sol
Created February 13, 2021 03:02
A gas-efficient mintable, lockable NFT creation contract for OpenSea listing.
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./FeeOwner.sol";
@Andrey2G
Andrey2G / encoding.txt
Last active June 13, 2024 07:55
Video Encoding with multiple resolutions
ffmpeg -i "c:/videos/sample.mp4
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v libx264 -crf 22 -c:a aac -ar 48000
-filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k
-filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k
-filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p"
-preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3
-hls_flags independent_segments -master_pl_name "name-pl.m3u8"
"c:/videos/encoded/name-%v.m3u8"
@duhaime
duhaime / index.html
Last active November 8, 2023 21:22
GPU Picking (Three.js)
<html>
<head>
<style>
html, body { width: 100%; height: 100%; background: #000; }
body { margin: 0; overflow: hidden; }
canvas { width: 100vw; height: 100vh; }
#selected { position: absolute; top: 10; left: 10; font-size: 40; color: black; background: #fff; width: 100%;}
</style>
</head>
<body>
@eeropic
eeropic / paste-svg-from-clipboard-paper.js
Last active April 25, 2024 06:58
Paste SVG to Paper.js from clipboard
//CC2018
document.addEventListener('paste', function(evt) {
//Import SVG copied to clipboard from Illustrator
//remove last hidden character that will otherwise break the import
if(document.activeElement.nodeName!="TEXTAREA"){
var str=evt.clipboardData.getData('text/plain').slice(0, -1);
var svg=project.importSVG(str)
svg.clipped=false;
svg.children[0].remove()
svg.parent.insertChildren(svg.index,svg.removeChildren());
@jsantell
jsantell / web-ar-projects.md
Last active June 29, 2019 03:01
Projects for WebARonARKit and WebARonARCore

Projects for WebARonARKit and WebARonARCore

New Projects

Leave a comment to add a project you've created or found!

Browsers

import { Component } from "react";
import { connect } from "react-redux";
import { getTicket, getAssignedTickets } from "../../actions";
import { getJWToken } from "../../middleware/api";
class Socket extends Component {
getWebsocketServerLocation() {
const host = window.document.location.host.replace(/:.*/, "");
return "ws://" + host + ":8010";
@nasitra
nasitra / Flatland Dark.tmTheme
Last active June 28, 2016 13:22
Insert color scheme settings to Flatland theme for Sublime Text 3 (build 3103)
...
<dict>
<key>name</key>
<string>Entity.name.label</string>
<key>scope</key>
<string>entity.name.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#F8F8F8</string>
@fjenett
fjenett / apiservice.js
Created April 12, 2015 11:20
Using Piecemeta API node.js client
var PMApi = require('piecemeta-apiclient');
var ls_apiKey, ls_access_token;
var authService = (function(){
var auth = {
api_key : null,
access_token : null,
getCredentials : function () {
@bastianallgeier
bastianallgeier / controllers--contact.php
Created October 1, 2014 19:36
Plain contactform example for Kirby 2
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
@mflux
mflux / twojshack.js
Created September 25, 2014 05:55
TWO.js text hack
/*
Goes after
Polygon.MakeObservable(Polygon.prototype);
//...
*/
var Text = Two.Text = function( text ) {