Skip to content

Instantly share code, notes, and snippets.

View AdrianSkar's full-sized avatar
:octocat:

Adrian Skar AdrianSkar

:octocat:
View GitHub Profile
@jesperorb
jesperorb / html-string-vs-createElement.js
Last active October 23, 2023 14:53
Pros and cons using .insertAdjacentHTML vs .createElement
/**
* There is a pro to using document.createElement() instead of just applying a
* string to the page that gets converted to HTML. When we use the pure string method
* we do not get a link/reference to the actual element that is seen on the page. This
* usually means we have to get the element again to modify it. For example, add an event
* listener
*/
//-----------------------------------------------
// .createElement() + .addEventListener()
// loop-recursion.js
// Looping vs. Recursion
//
let fetch = require('node-fetch');
let url = "http://jsonplaceholder.typicode.com/comments?postId=42";
let log = console.log;
let count = 0;
const SIZE = 120;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document Fragments</title>
<style type="text/css">
html{
font-size: 120%;
font-family: BlinkMacSystemFont, -apple-system, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif;
@nucliweb
nucliweb / CSS-Tools.md
Last active June 24, 2024 17:11
CSS Tools
@darekkay
darekkay / trakt-backup.php
Last active August 24, 2024 13:03
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@vsoch
vsoch / index.php
Last active June 2, 2024 14:28
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";
@c0ldlimit
c0ldlimit / git_newrepo
Created November 16, 2012 17:14
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line