Skip to content

Instantly share code, notes, and snippets.

View hising's full-sized avatar

Mattias Hising hising

View GitHub Profile
@nikasepiskveradze
nikasepiskveradze / react-query-lite.js
Last active May 29, 2024 09:24
Lightweight implementation of React Query
import React from "react";
const context = React.createContext();
export function QueryClientProvider({ children, client }) {
React.useEffect(() => {
const onFocus = () => {
client.queries.forEach((query) => {
query.subscribers.forEach((subscriber) => {
subscriber.fetch();
@oliveratgithub
oliveratgithub / emojis.json
Last active May 29, 2024 07:32
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@niksumeiko
niksumeiko / git.migrate
Last active May 13, 2024 15:34
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@rmariuzzo
rmariuzzo / sprintf.js
Created February 2, 2014 01:16
Simple and minimal `sprintf` function in JavaScript.
function sprintf(format) {
var args = Array.prototype.slice.call(arguments, 1);
var i = 0;
return format.replace(/%s/g, function() {
return args[i++];
});
}
@atma
atma / nginx.conf
Created August 18, 2013 16:45
Nginx + nodejs + socket.io websockets
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active March 22, 2024 20:18
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@md2perpe
md2perpe / sd-definitioner.md
Last active August 6, 2018 15:08
Sverigedemokratiska definitioner
  • vänsterextremist, vänsterpack = person(-er) som inte delar SD:s åsikter
  • politiskt korrekt = egenskap hos varje person som inte delar SD:s åsikter; motsatsen är politiskt inkorrekta vilket här blir ett positivt laddat ord.
  • censur = när SD-positiva eller rasistiska inlägg raderas, men inte när SD-negativa eller antirasistiska inlägg raderas
  • tryckfrihet = lag som borde ge dig rätten att smutskasta invandrare, men inte att tala negativt om SD
  • tänka självständigt = dela SD:s åsikter
  • övergrepp av rättssamhället = när en sverigedemokrat döms för brott
  • landsförrädare = en som inte röstar på SD
  • antidemokratisk = alla som inte aktivt underlättar för Sverigedemokraterna.
  • odemokratiskt = när partier valda av 95% av befolkningen styr och inte SD.
  • avskräde = motdemonstrant
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc