Skip to content

Instantly share code, notes, and snippets.

@raspi
raspi / pacman-auto-update.service
Last active June 2, 2024 03:19
Arch Linux Pacman auto download updated packages
# Download new packages but don't install them
# Save in /etc/systemd/system/
[Unit]
Description=Pacman Automatic Download (no install) service
After=network-online.target
[Service]
# Wait time if process hangs
TimeoutStopSec=5m
@montanaflynn
montanaflynn / poker.go
Last active June 2, 2024 03:17
Generate a deck of cards, shuffle it and then deal them out in Golang
package main
import (
"fmt"
"math/rand"
"os"
"time"
)
// Card holds the card suits and types in the deck
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active June 2, 2024 03:17
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

@peace098beat
peace098beat / MainApplication.py
Created April 28, 2015 12:18
[PyQt] Drag and Drop files
class MainWidget(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWidget, self).__init__(parent)
self.setWindowTitle("FiFiFactory App")
self.resize(720,480)
self.setAcceptDrops(True)
def dragEnterEvent(self, event):
if event.mimeData().hasUrls():
event.accept()
$ pkg update
$ pkg install nmap
@kvnxiao
kvnxiao / awesome-selfhosted-sorted-by-stars.md
Last active June 2, 2024 03:10
awesome-selfhosted-sorted-by-stars.md

Awesome-Selfhosted

Awesome

Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.

This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.

See Contributing.

@midgethetree
midgethetree / 0parallax.rpy
Last active June 2, 2024 03:06
Parallax code for the Ren'Py visual novel engine.
python early:
class ParallaxLayer(renpy.Displayable):
def __init__(self, child, xmotion, ymotion, replaces=None, **kwargs):
super(ParallaxLayer, self).__init__(**kwargs)
self.child = renpy.displayable(child)
self.xmotion, self.ymotion = xmotion, ymotion
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@jmatsushita
jmatsushita / README
Last active June 2, 2024 03:00
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@charveey
charveey / 75-noto-color-emoji.conf
Created June 29, 2019 07:14
How to better enable Color Emojis! Fontconfig ships with some config files that are simply not enough to enable color emojis globally (the 45-generic.conf and 60-generic.conf) and just by installing Noto Color Emoji font will also not enable colorful emojis on all websites or some apps. However, this can easily be configured by creating a config…
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Add generic family. -->
<match target="pattern">
<test qual="any" name="family"><string>emoji</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
</match>