Skip to content

Instantly share code, notes, and snippets.

View maximillian2's full-sized avatar

Maksym Tymoshyk maximillian2

  • EPAM Systems
  • Kyiv, Ukraine
  • 18:14 (UTC +03:00)
View GitHub Profile
@ismnoiet
ismnoiet / refresh-spotlight-index.sh
Last active July 26, 2017 20:02
Refresh spotlight index to list the newly installed applications
# pboblem : some applications can't be found using spotlight search box.
# solution : reload the metadata plist
# source : http://apple.stackexchange.com/questions/62715/applications-dont-show-up-in-spotlight
# Turn off spotlight
sudo mdutil -a -i off
# Unload it :
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
@Erichain
Erichain / msconvert.js
Last active December 25, 2023 19:15 — forked from remino/msconvert.js
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS( milliseconds ) {
var day, hour, minute, seconds;
seconds = Math.floor(milliseconds / 1000);
minute = Math.floor(seconds / 60);
seconds = seconds % 60;
hour = Math.floor(minute / 60);
minute = minute % 60;
day = Math.floor(hour / 24);
hour = hour % 24;
return {
@saeidzebardast
saeidzebardast / Enable CORS in Spark Java
Created March 8, 2016 10:30
Enable CORS in Spark Java to allow origins *
options("/*",
(request, response) -> {
String accessControlRequestHeaders = request
.headers("Access-Control-Request-Headers");
if (accessControlRequestHeaders != null) {
response.header("Access-Control-Allow-Headers",
accessControlRequestHeaders);
}
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote