Skip to content

Instantly share code, notes, and snippets.

View drKreso's full-sized avatar

Kresimir Bojcic drKreso

View GitHub Profile
@ismyrnow
ismyrnow / mac-clear-icon-cache.sh
Created May 5, 2017 19:28
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
@matija
matija / jwt_auth_controller.rb
Last active April 11, 2018 14:39
jwt_auth_controller.rb
class JWTAuthController < ActionController::API
attr_reader :current_user
protected
def authenticate_request!
fail StandardError.new('NotAuthenticatedError') unless user_id_included_in_auth_token?
@current_user = User.find(decoded_auth_token['user_id'])
rescue JWT::ExpiredSignature
raise StandardError.new('AuthenticationTimeoutError')
#!/usr/bin/env perl
# Copyright (c) 2015 Sergey Lyubka
# All rights reserved
use Encode;
my $dir = "/Users/$ENV{USER}/.Trash";
sub read_file($) { local $/; open FD, $_[0] or die $_[0]; binmode FD; <FD>; }
@rickharrison
rickharrison / jekyll.nginxconf
Created September 2, 2013 07:41
Nginx server config with clean URLs for Jekyll.
server {
listen 80;
server_name www.yourdomain.com;
return 301 $scheme://yourdomain.com$request_uri;
}
server {
listen 80;
root /var/www/yourdomain.com;