Skip to content

Instantly share code, notes, and snippets.

View hitautodestruct's full-sized avatar

Yotam hitautodestruct

View GitHub Profile
@hitautodestruct
hitautodestruct / reset.md
Created July 17, 2018 12:58
Reset root password on scaleway.com
@hitautodestruct
hitautodestruct / readme.md
Last active September 26, 2022 11:25 — forked from anonymous/gist:4344870
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015

@hitautodestruct
hitautodestruct / deepFreeze.js
Created December 23, 2021 09:06
A method for recursively freezing nested objects, for use with vuex store
function deepFreeze (object) {
if (object) {
// Retrieve the property names defined on object
var propNames = Object.getOwnPropertyNames(object)
// Freeze properties before freezing self
for (let name of propNames) {
let value = object[name]
object[name] = value && typeof value === 'object' ? DataMigration.deepFreeze(value) : value
@hitautodestruct
hitautodestruct / mysql-dump.sh
Last active August 12, 2019 06:34
An example of exporting an sql db from mysql from a cli
# export dump
mysqldump -u [username] -p[password] [dbname] | gzip > ~/[dbname].sql.gz
# import
mysql -u username -p database_name < file.sql
@hitautodestruct
hitautodestruct / kermit.base64
Created August 1, 2019 08:06
kermit base64
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAEEAOEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9+tlCptp1FABRRRQAUUUUAR0UUUAFFFFABRL3ool70AOTpTqQDAoY4FJuwC0jHAoDZqOSQ0ubS6Aj+07DgnHU5PAwD659KL2+W1t2kY7UTq2M/pX5Y/tlf8FIvjX+yZ+2/wCLtK1COLS/Ddw8J8O2V5Eklnf2iqE85JMruLtu3
@hitautodestruct
hitautodestruct / closeport.sh
Created June 4, 2019 10:03
MacOS How to close app that is taking up port
lsof -i :5000 # Search for app
(sudo) kill <PID>
@hitautodestruct
hitautodestruct / MultiRoot.vue
Last active April 10, 2019 12:03
Trying to cheat vue 2 into allowing multiple root components
<script>
export default {
name: 'MultiRoot',
functional: true,
render(h, { children }) {
return children.map(vnode => <components is={vnode.context.$options.name} />)
},
}
</script>
@hitautodestruct
hitautodestruct / zip.md
Last active September 12, 2018 16:58
Zip files on osX without Icon or DS_Store

Terminal command to zip up files excluding unwanted Icon and DS_Store files

zip my_zip_file.zip -r dir_to_zip -x "*Icon*" "*.DS_Store"
@hitautodestruct
hitautodestruct / rsync.sh
Last active August 2, 2018 07:59
Synch files using rsync on mac
rsync -rav /source /destination
# in order to exlude files
rsync -rav --exclude=node_modules --exclude=.DS_Store /source /destination
@hitautodestruct
hitautodestruct / external.sh
Created July 12, 2018 11:40
cd into external hard disk macos terminal
cd /Volumes && ls