Skip to content

Instantly share code, notes, and snippets.

@todesstoss
todesstoss / changing_user_transmission-daemon.sh
Created March 28, 2020 16:35 — forked from n1mh/changing_user_transmission-daemon.sh
Changing user for transmission-daemon in raspberry pi
#!/bin/bash
sudo /etc/init.d/transmission-daemon stop
sudo chown -R pi:pi /etc/transmission-daemon
sudo rm -rf ~pi/.config/transmission-daemon
sudo mv /etc/transmission-daemon ~pi/.config/
sudo ln -s ~pi/.config/transmission-daemon /etc/transmission-daemon
sudo chown pi:pi /etc/default/transmission-daemon
@todesstoss
todesstoss / ExampleContext.js
Created May 9, 2019 09:56
React Context snippet
import React, { createContext } from 'react';
import * as constants from './constants';
const ExampleContext = createContext();
const { Consumer, Provider } = ExampleContext;
const UserProvider = ({ children }) => {
return <Provider value={{}}>{children}</Provider>;
};
class MediaQueryListener {
afterElement = window.getComputedStyle ? window.getComputedStyle(document.body, ':after') : false;
currentBreakpoint = '';
lastBreakpoint = '';
constructor() {
if(!this.afterElement) {
return;
}
@todesstoss
todesstoss / sample-nginx.conf
Created July 10, 2017 13:05 — forked from cjus/sample-nginx.conf
AngularJS Nginx and html5Mode
server {
server_name yoursite.com;
root /usr/share/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095