Skip to content

Instantly share code, notes, and snippets.

View musa11971's full-sized avatar
☝️
‌‌

Musa musa11971

☝️
‌‌
View GitHub Profile
@krishaantechnology
krishaantechnology / tailwind.config.js
Created February 12, 2023 01:25
Tailwind CSS: Shake Animation
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
purge: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
@ronaldsuwandi
ronaldsuwandi / docker-compose.yml
Last active May 27, 2024 09:28
Docker Compose for Jupyter Lab/Notebook (no token/password required)
version: "3.9"
services:
jupyter:
image: quay.io/jupyter/scipy-notebook
ports:
- "8888:8888"
volumes:
- ./notebooks:/home/jovyan/
environment:
@ypresto
ypresto / safari-11-file-xhr-workaround-2.js
Last active September 6, 2018 13:47
iOS 11.3 Safari / macOS Safari 11.1 empty <input type="file"> XHR bug workaround for rails-ujs / jquery_ujs
// iOS 11.3 Safari / macOS Safari 11.1 empty <input type="file"> XHR bug workaround.
// This should work with every modern browser which supports ES5 (including IE9).
// https://stackoverflow.com/questions/49614091/safari-11-1-ajax-xhr-form-submission-fails-when-inputtype-file-is-empty
// https://github.com/rails/rails/issues/32440
document.addEventListener('ajax:before', function(e) {
var inputs = e.target.querySelectorAll('input[type="file"]:not([disabled])')
inputs.forEach(function(input) {
if (input.files.length > 0) return
input.setAttribute('data-safari-temp-disabled', 'true')
@olssonm
olssonm / macos-disable-resize
Last active June 8, 2024 18:02
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
@gf3
gf3 / iTunes.swift
Created August 29, 2017 18:50
iTunes ScriptingBridge from Swift
import AppKit
import ScriptingBridge
@objc public protocol SBObjectProtocol: NSObjectProtocol {
func get() -> Any!
}
@objc public protocol SBApplicationProtocol: SBObjectProtocol {
func activate()
var delegate: SBApplicationDelegate! { get set }
@alexsanchezdev
alexsanchezdev / URLSession.swift
Last active December 12, 2019 14:33
URLSession download images example | Swift 3
if let image = imageURL {
let url = URL(string: image)
URLSession.shared.dataTask(with: url!, completionHandler: { (data, response, error) in
if error != nil {
print(error!)
return
}
DispatchQueue.main.async {
@JalfResi
JalfResi / revprox.go
Last active June 7, 2024 05:18
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {