Skip to content

Instantly share code, notes, and snippets.

@fung1
fung1 / tailwind-webpack-setup.md
Created July 12, 2023 07:21 — forked from bradtraversy/tailwind-webpack-setup.md
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@fung1
fung1 / gist:670c2c6dad460cadfddca8d8a00bc4e7
Created June 27, 2020 14:09
JavaScript: Google Map with multiple markers
<!-- https://developers.google.com/maps/documentation/javascript/tutorial#Audience -->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html{ height:100%; }
@fung1
fung1 / scrape.php
Created April 2, 2018 09:28 — forked from jongacnik/scrape.php
Tumblr image scrape
<?php
$offset = 0;
$count = 50;
$domain = $argv[1];
$tagged = isset($argv[2]) ? $argv[2] : false;
$api = 'http://' . $domain . '.tumblr.com/api/read/json?debug=1&num=' . $count . ($tagged ? '&tagged=' . $tagged : '');
function scrape ($api, $count, $offset) {
@fung1
fung1 / tumblr.php
Created April 2, 2018 09:24 — forked from petrkle/tumblr.php
Simple tumblr image downloader.
<?php
define('IMGDIR','./img');
require('sites.php');
foreach($sites as $site){
$rss = get_rss('http://'.$site.'.tumblr.com/rss');
if(count($rss)>0){
if(!is_dir(IMGDIR.'/'.$site)){
mkdir(IMGDIR.'/'.$site,0700,true);
}