Skip to content

Instantly share code, notes, and snippets.

View deathbeam's full-sized avatar

Tomas Slusny deathbeam

  • Slovakia
  • 09:20 (UTC +02:00)
View GitHub Profile
@Nightfirecat
Nightfirecat / runelite-blog.sh
Last active November 28, 2019 08:22
runelite.net blog post generator
#!/bin/bash
# Exit upon errors
set -e
description() {
echo 'Creates a new branch and file structure for the weekly release blog post in the runelite.net repository'
}
helpdoc() {
echo
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 23, 2024 22:30
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@ericbn
ericbn / .vimrc
Last active March 31, 2024 10:39
Vim Powerline-like status line without the need of any plugin
" Statusline (requires Powerline font)
set statusline=
set statusline+=%(%{&buflisted?bufnr('%'):''}\ \ %)
set statusline+=%< " Truncate line here
set statusline+=%f\ " File path, as typed or relative to current directory
set statusline+=%{&modified?'+\ ':''}
set statusline+=%{&readonly?'\ ':''}
set statusline+=%= " Separation point between left and right aligned items
set statusline+=\ %{&filetype!=#''?&filetype:'none'}
set statusline+=%(\ %{(&bomb\|\|&fileencoding!~#'^$\\\|utf-8'?'\ '.&fileencoding.(&bomb?'-bom':''):'')
@trekdemo
trekdemo / README.md
Created September 22, 2016 07:30
Setup ctags with git

Create a folder to store git hook templates

# ~/.gitconfig

[init]
  templatedir = ~/.git_templates

The following files are in ~/.git_templates/hooks/

@benpickles
benpickles / action.js
Created March 18, 2016 16:19
Inject an Authorization header into a redux-api-middleware request with a Redux middleware.
import { CALL_API } from 'redux-api-middleware'
export function fetchLocations() {
return {
[CALL_API]: {
endpoint: 'http://api.somesite.com/api/locations',
method: 'GET',
// Don't have to manually add the Authorization header to every request.
headers: { 'Content-Type': 'application/json' },
types: ['REQUEST', 'SUCCESS', 'FAILURE']
@srph
srph / oauth.js
Created February 21, 2016 13:50
axios: interceptor which includes your oauth token in every request as an Authorization header
import axios from 'axios';
// You can use any cookie library or whatever
// library to access your client storage.
import cookie from 'cookie-machine';
axios.interceptors.request.use(function(config) {
const token = cookie.get(__TOKEN_KEY__);
if ( token != null ) {
config.headers.Authorization = `Bearer ${token}`;
# Pythonic module system
from Sys import print
# Annotations and generic types
\:generic
class MyValue<T>
# Fat arrow closures means no implicit return
new = (value : T) =>
@value = value
@deathbeam
deathbeam / Main.rb
Last active September 23, 2015 12:06
Raxe example
# Require some other modules
require "openfl/display/Sprite"
require "openfl/events/Event"
require "openfl/Lib"
# Set type of this module to class and extend it by OpenFL sprite
module class extends Sprite
# Module variables
def static appname = "My Application"
@tadly
tadly / pacaur_install.sh
Last active August 30, 2023 13:15
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
#
# !!! IMPORTANT !!!
# As of 2017-12-14, pacaur is unmaintained (https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144)
# For alternatives see the arch wiki: https://wiki.archlinux.org/index.php/AUR_helpers#Active
# pacaur seems to get occasional updates to fix breaking changes due to pacman updates though.
#
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
@soyo42
soyo42 / .Yang_tree_path_dumper
Last active January 10, 2017 14:44
yangTree path dump helper
this is project name keeper