Skip to content

Instantly share code, notes, and snippets.

View frhd's full-sized avatar
🏠
Working from home

farhad frhd

🏠
Working from home
  • quantyc
  • Göttingen, Germany
  • 15:44 (UTC +02:00)
  • X @frhd27
View GitHub Profile
@frhd
frhd / remove_sl_icon.sh
Created July 19, 2020 15:06 — forked from ulasozguler/remove_sl_icon.sh
Remove spotlight icon from menu bar.
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak
sudo codesign -f -s - Spotlight
sudo killall Spotlight
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@frhd
frhd / hosts
Created February 24, 2019 17:06 — forked from aparajita/hosts
hosts file entries to block Facebook
# Block facebook!
0.0.0.0 static.ak.fbcdn.net
0.0.0.0 www.connect.facebook.net
0.0.0.0 www.facebook.com
0.0.0.0 www.fbcdn.com
0.0.0.0 www.fbcdn.net
0.0.0.0 www.graph.facebook.com
0.0.0.0 www.login.facebook.com
0.0.0.0 www.s-static.ak.facebook.com
0.0.0.0 www.static.ak.connect.facebook.com
@frhd
frhd / readme.md
Created December 21, 2017 00:07 — forked from max-mapper/readme.md
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
@frhd
frhd / DropwizardJettyCrossOriginIntegrationTest.java
Created July 7, 2016 09:35 — forked from mrserverless/DropwizardJettyCrossOriginIntegrationTest.java
Dropwizard 0.8.0 and 0.9.0 Jetty CORS Filter with Unit Tests. To prove this works once and for all
import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.setup.Environment;
import io.dropwizard.testing.junit.DropwizardAppRule;
import org.assertj.core.data.MapEntry;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.junit.ClassRule;
import org.junit.Test;
@frhd
frhd / build.gradle
Created April 20, 2016 13:18 — forked from spikeheap/build.gradle
Gradle build script to install NodeJS packages and Bower dependencies. This assumes you create package.json (nodejs) and bower.json files in the root of your project.
import org.gradle.api.tasks.Exec
defaultTasks 'bower'
// Get the path for the locally installed binaries
task npmBin << {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'npm'
args = ['bin']
@frhd
frhd / jsf.md
Created March 2, 2016 10:56 — forked from nekman/jsf.md
Don't use JSF

JSF?!

http://www.thoughtworks.com/radar/#/languages-and-frameworks/683 - ThoughtWorks Technology Radar - January 2014

We continue to see teams run into trouble using JSF -- JavaServer Faces -- and are recommending you avoid this technology. Teams seem to choose JSF because it is a J2EE standard without really evaluating whether the programming model suits them. We think JSF is flawed because it tries to abstract away HTML, CSS and HTTP, exactly the reverse of what modern web frameworks do. JSF, like ASP.NET webforms, attempts to create statefulness on top of the stateless protocol HTTP and ends up causing a whole host of problems involving shared server-side state. We are aware of the improvements in JSF 2.0, but think the model is fundamentally broken. We recommend teams use simple frameworks and embrace and understand web technologies including HTTP, HTML and CSS.


http://www.jfokus.se/jfokus/talks.jsp - Search for JSF... (one hit on why you should leave it)
http://architecture-musings.blo
@frhd
frhd / readme.md
Last active August 29, 2015 14:27 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@frhd
frhd / fancy-cli-dl.sh
Created November 19, 2014 10:05
fancy cli downloader
sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"