Skip to content

Instantly share code, notes, and snippets.

View marco-land's full-sized avatar

Marco Land marco-land

View GitHub Profile
@wobsoriano
wobsoriano / auth.js
Last active February 29, 2024 07:37
nuxtServerInit like implementation for Pinia
import { defineStore } from 'pinia'
export const useAuthStore = defineStore({
id: 'auth',
state: () => ({
isAuthenticated: false,
user: null
}),
actions: {
async nuxtServerInit() {

Uberspace

Uberspace is webhosting for nerds and everybody. Currently uberspace is aroudn 12 people who do what they do to make technology more approachable.

It is a great place to learn and test and also run small projects (or not so small ones) in production.

It is shared hosting - that makes some things a little bit difficult - but if you run into problems they are a great help.

Nuxt

@mcissel
mcissel / flickityMarquee.js
Created February 28, 2019 15:22
Flickity Marquee Scroll
function wrapper() {
this.$row = ''; // gotta have a Flickity slider row
this.scrollMultiplier = 0;
function () {
// needs $row first
const onEnter = (forward) => () => self.flickityRowScroll(type, fabric, forward);
const onLeave = () => self.flickityRowStopScroll(type, fabric);
const $leftTrig = $('.more-left', $row);
@wottpal
wottpal / kirby-nginx
Last active November 15, 2018 19:20
#######################
#######################
# KIRBY-CONFIGURATION #
# block content
location ~ ^/content/(.*).(txt|md|mdown)$
{
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
@dkarchmer
dkarchmer / ffmpeg-resize.js
Last active March 14, 2024 17:32
Example of NodeJS script to resize videos (to 1080P and 720P) using fluent-ffmpeg
(function () {
var ffmpeg = require('fluent-ffmpeg');
function baseName(str) {
var base = new String(str).substring(str.lastIndexOf('/') + 1);
if(base.lastIndexOf(".") != -1) {
base = base.substring(0, base.lastIndexOf("."));
}
return base;
}
@pfloh
pfloh / Berlin_gemeinden_simplify0.geojson
Created December 2, 2015 20:59
Berlin as geojson map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rxaviers
rxaviers / gist:7360908
Last active July 6, 2024 15:52
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@malarkey
malarkey / Contract Killer 3.md
Last active July 5, 2024 08:43
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@yorkxin
yorkxin / avoid-jquery-when-possible.md
Created July 7, 2012 13:04
Avoid jQuery When Possible

Avoid jQuery When Possible

jQuery does good jobs when you're dealing with browser compatibility. But we're living in an age that fewer and fewer people use old-school browsers such as IE <= 7. With the growing of DOM APIs in modern browsers (including IE 8), most functions that jQuery provides are built-in natively.

When targeting only modern browsers, it is better to avoid using jQuery's backward-compatible features. Instead, use the native DOM API, which will make your web page run much faster than you might think (native C / C++ implementaion v.s. JavaScript).

If you're making a web page for iOS (e.g. UIWebView), you should use native DOM APIs because mobile Safari is not that old-school web browser; it supports lots of native DOM APIs.

If you're making a Chrome Extension, you should always use native APIs, not only because Chrome has almost the latest DOM APIs available, but this can also avoid performance issue and unnecessary memory occupation (each jQuery-driven extension needs a separate