Skip to content

Instantly share code, notes, and snippets.

@demircancelebi
demircancelebi / xmlToJson.js
Last active September 1, 2023 12:40 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
// Changes XML to JSON
// Modified version from here: http://davidwalsh.name/convert-xml-json
xmlToJson(xml) {
// Create the return object
let obj = {};
if (xml.nodeType === 1) { // element
// do attributes
if (xml.attributes.length > 0) {
obj['@attributes'] = {};
@zehfernandes
zehfernandes / pliim-turnOff.scpt
Last active September 16, 2024 06:39
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@Liquidream
Liquidream / outline_sprite.p8.lua
Last active October 23, 2021 16:20
Useful sprite draw function for PICO-8 (and maybe Lua in general)
--
-- draws a sprite to the screen with an outline of the specified colour
--
function outline_sprite(n,col_outline,x,y,w,h,flip_x,flip_y)
-- reset palette to black
for c=1,15 do
pal(c,col_outline)
end
-- draw outline
for xx=-1,1 do
@christopheranderton
christopheranderton / montserrat-font-family-styles.css
Last active May 5, 2023 08:18
Montserrat Font Family Styles (Montserrat, Montserrat Alternates, Montserrat Subrayada, Montserrat Arabic). Weights, Font feature settings, Download sources…
/* == Montserrat Font Family Styles == */
/* @group Montserrat
-------------------------------------------------------------- */
/* = Weights Montserrat
-------------------------------------------------------------- */
.thin {
anonymous
anonymous / mario.json
Created September 17, 2017 17:51
Mario Vector
[[[15,15,25,177,22,151,31,135,42,136,58,89,126,80,190,91,206,119,211,135,224,136,234,150,231,173,216,196,208,198,198,219,155,245,127,252,102,245,83,235,61,221,47,200,35,193],[4,4,73,97,95,88,108,99,112,113,95,102,82,104,71,115],[4,4,149,99,159,88,180,96,184,114,172,102,158,103,145,116],[15,14,24,150,33,137,45,138,48,200,36,189,26,174],[4,4,47,175,43,164,42,134,45,108,57,111,54,157],[15,14,231,170,215,193,208,198,209,173,214,137,223,139,231,150],[4,4,208,173,199,154,201,108,215,129,212,167],[8,8,33,128,28,104,41,69,63,39,92,12,127,7,149,8,182,24,202,47,224,88,228,118,217,136,207,117,177,94,126,85,66,99,44,121,42,134],[8,14,165,70,207,90,214,105,209,121,210,106,202,93,164,75,106,72,65,84,46,101,45,118,41,101,61,80,106,67],[7,7,102,28,129,19,152,27,164,45,153,68,102,67,92,48],[8,8,100,55,116,26,128,35,140,25,157,54,148,61,138,38,127,49,117,38,109,61],[7,7,82,123,93,116,107,122,114,137,113,147,100,153,94,165,84,161,80,152,78,140],[7,7,144,129,151,119,162,117,172,124,176,134,175,150,172,161,162,166,159,157,150,149
@Powersaurus
Powersaurus / rayzzz-0.2.p8
Created August 26, 2017 15:21
Pico-8 raycaster version 0.2
pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
-- raycaster demo
-- by @powersaurus
-- based heavily on http://lodev.org/cgtutor/raycasting.html
-- and http://lodev.org/cgtutor/raycasting2.html
-- and inspired by the work of @matthughson
-- thanks for advice from @kometbomb and @doyousketch2 and @krajzeg
--
@crittermike
crittermike / wget.sh
Last active March 28, 2025 18:44
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@NaveenDA
NaveenDA / List-of-search-engine.json
Created July 5, 2017 05:47
List of Search Engine in Json Format
[
{
"name": "Google",
"url": "http:\/\/www.google.com"
},
{
"name": "Bing",
"url": "http:\/\/www.bing.com"
},
{
@KinoAR
KinoAR / Rotations.lua
Last active February 16, 2021 19:02
The Pico-8 code showing off rotations math.
--rotations by eis - kino
--globals
--The sprites, the position (x and y) of both star1 and star2
star1 ={sprite=2, x = 58, y = 58}
star2 ={sprite=3, x = 0, y = 0}
degrees = 0
function _update()
--Here we rotate star2 around star1 by giving rotate star1's position(x, y).