Skip to content

Instantly share code, notes, and snippets.

View NickHatBoecker's full-sized avatar

Nick NickHatBoecker

View GitHub Profile
@NickHatBoecker
NickHatBoecker / NotificationHelper.php
Last active July 30, 2019 08:03
Push Notifications für Webapps mit OneSignal
<?php
namespace AppBundle\Service;
use GuzzleHttp\Client;
use Http\Client\Common\HttpMethodsClient;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use OneSignal\Config;
use OneSignal\OneSignal;
@NickHatBoecker
NickHatBoecker / crypto_coins.php
Last active July 9, 2017 14:05
PHP Script for macOS crypto currencies widget
<?php
/*
* Author: Nick Böcker
* Created: 09.07.2017
* Homepage: https://nick-hat-boecker.de
*/
class CryptoCoins
{
private $curl;
private $apiBaseUrl = 'https://min-api.cryptocompare.com/data/price';
<?php
// Wir importieren alle nötigen PHP Dateien
require __DIR__.'/alexa-endpoint/autoload.php';
use MayBeTall\Alexa\Endpoint\Alexa;
use MayBeTall\Alexa\Endpoint\User;
// Damit sind wir bereit auf Alexa-Anfragen zu reagieren
Alexa::init();
@NickHatBoecker
NickHatBoecker / config
Created August 21, 2018 11:00
Git Alias lastCommitUrl
lastCommitUrl = !sh -c 'printf "https://github.com/theskyliner/CopyFilepathWithLineNumbers/commit/%s" "$(git rev-parse HEAD)" && echo "\n"'
@NickHatBoecker
NickHatBoecker / README.md
Last active June 20, 2019 19:45
List aliases in a table like view

List your aliases in a table like view.

Save list_aliases.sh in your home directory in a bin directory. Create a file named .aliases in your home directory. Add all your aliases like this:

alias ..="cd .." # Navigate one directory down
@NickHatBoecker
NickHatBoecker / move-wordpress.sh
Last active December 21, 2020 10:26
Moving Wordpress: Update SQL Statements
#!/bin/bash
#
# This script is used to update database url entries for wordpress.
#
# © Nick Böcker <https://nick-hat-boecker.de> 2019
# User input mysql username
read -p "Enter mySQL username [root]: " USER
USER=${USER:-root}
@NickHatBoecker
NickHatBoecker / HueApiHelper.php
Created July 21, 2019 18:04
Bypass Philipps Hue HTTPS Certificate
<?php
/**
* This script is used to bypass the certificate error of philipps hue api when working with Javascript.
* You have to set an environment variable HUE_API_BASE_URL with the Hue Bridge IP and your hue userid.
*
* Example: https://192.168.0.1/api/hgdjklhKHFJLDSKHLHJFHKWHLwkhljl/lights
*/
class HueApiHelper
{
const METHOD_DELETE = 'DELETE';
@NickHatBoecker
NickHatBoecker / eslint.sublime-completions
Created July 21, 2019 19:38
eslint autocomplete for Sublime Text 3
{
"completions":
[
{ "trigger": "eslint-disable-line\tDisable rule for this line", "contents": "// eslint-disable-line ${1:rule}" },
{ "trigger": "eslint-disable-next-line\tDisable rule for next line", "contents": "// eslint-disable-next-line ${1:rule}" },
]
}
@NickHatBoecker
NickHatBoecker / Bookmarks.js
Last active August 17, 2019 16:57
Vuex: Add bookmark problem
import axios from 'axios'
import store from '@/store'
import { getCategoryBookmarks } from '@/helpers/Categories.js'
export const loadBookmarks = async () => {
const response = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/get-all/`)
if (!response || !response.data) {
return []
}
@NickHatBoecker
NickHatBoecker / twitch_show_game_name.html
Last active November 19, 2019 23:19
Show current game name of one user's twitch stream
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8" />
<title></title>
<style>
@import url(https://db.onlinewebfonts.com/c/9882baf89f6a50439487112cbd8a91dd?family=UA+Cadet);