Skip to content

Instantly share code, notes, and snippets.

View sfw185's full-sized avatar

Simon Wardan sfw185

View GitHub Profile
# Clear any existing wallpaper image
Set-ItemProperty -Path 'HKCU:\Control Panel\Personalization\Desktop\' -Name Wallpaper -Value ''
# Set WallpaperStyle to 0 (Center)
Set-ItemProperty -Path 'HKCU:\Control Panel\Personalization\Desktop\' -Name WallpaperStyle -Value '0'
# Disable tiling of wallpaper
Set-ItemProperty -Path 'HKCU:\Control Panel\Personalization\Desktop\' -Name TileWallpaper -Value '0'
# Set SolidColor to black (0)
@sfw185
sfw185 / simple_web_server.sh
Created July 21, 2021 05:13
Fire up a python web server that serves files from the current working directory
python -m SimpleHTTPServer
@sfw185
sfw185 / gource.sh
Created April 29, 2021 04:04
Gource commands
gource --viewport 1920x1080 --seconds-per-day 0.5 --logo ~/Downloads/logo.png --highlight-users --hide filenames -o ~/Downloads/gource.ppm
fmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -vcodec libx264 -preset medium -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
@sfw185
sfw185 / squash-commits.sh
Created December 20, 2018 00:21
Squash all branch commits against the merge-base of the master branch
git checkout yourBranch
git reset $(git merge-base master yourBranch)
git add -A
git commit -m "one commit on yourBranch"
@sfw185
sfw185 / restart coreaudio daemon
Created November 3, 2018 22:00 — forked from felipecsl/restart coreaudio daemon
Restart Mac OS X coreaudio daemon. Useful if you cannot change the audio output device to Airplay.
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
@sfw185
sfw185 / local-aws-lambda.js
Created October 22, 2018 21:54
A simple script to run an AWS Lambda application locally without modifying it or adding heavy frameworks
const handler = require('./index').handler; // index.js, exposing a handler function for AWS Lambda
const testData = require('./test'); // test.json, containing a payload to execute the function with
(async () => {
const result = await handler(testData);
console.log(result);
})();
@sfw185
sfw185 / wait-for-open-port.js
Last active February 25, 2019 23:15
A script that exits when the specified port is open on the local host, useful for testing if a local server has started
const http = require('http');
const timeoutInSeconds = 120;
const port = parseInt(process.argv[2]);
console.log('Waiting for port:', port);
if (port <= 0) {
throw Error('No port passed in');
}

Keybase proof

I hereby claim:

  • I am sfw185 on github.
  • I am simez (https://keybase.io/simez) on keybase.
  • I have a public key ASDpiyzmBe6ZTIPP_ZRW1fQR0Bv-9BumVwUYPI8Q-VHYLwo

To claim this, I am signing this object:

@sfw185
sfw185 / proxy.js
Created August 24, 2017 01:53 — forked from cmawhorter/proxy.js
Node script to forward all http requests to another server and return the response with an access-control-allow-origin header. Follows redirects.
// Usage: node proxy.js
// Open browser and navigate to http://localhost:8080/[url]
// Example: http://localhost:8080/http://www.google.com
var url = require('url')
, http = require('http')
, https = require('https');
var PORT = process.argv[2] || 8080;
var server = http.createServer(function(req, res) {
@sfw185
sfw185 / .zshrc
Last active January 31, 2024 00:32
zsh config backup
plugins=(brew git)
export ZSH=$HOME/.oh-my-zsh
export SDKROOT=$(xcrun --show-sdk-path)
export ANDROID_HOME=~/Library/Android/sdk
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export LDFLAGS=-L/usr/local/opt/qt/lib