Skip to content

Instantly share code, notes, and snippets.

View chrisciampoli's full-sized avatar

Christopher Ciampoli chrisciampoli

View GitHub Profile
@chrisciampoli
chrisciampoli / index.js
Created October 18, 2023 14:07
useObserver Custom React Hook
import React from 'react';
import { useIntersectionObserver } from './useIntersectionObserver'; // Import your custom hook
function MyComponent() {
const { observedRef, inView } = useIntersectionObserver();
return (
<div
className={`flex-1 parent-flex flex ${inView ? 'group inview' : ''}`}
ref={observedRef}
{
"1_Crate_To_Open": "1 Core to Open",
"See_All": "See All",
"A_to_Z": "A to Z",
"A_Xhr_Power": "- a {0}hr +2.5% Power",
"A_Xhr_Turbo": "- a {0}hr +5% Turbo",
"About": "About",
"About_GameTitleX": "About {0}",
"About_Earning": "About Earning",
"About_Resell": "About Resell",
@chrisciampoli
chrisciampoli / useful-npx-commands.md
Created December 7, 2020 12:28 — forked from gokulkrishh/useful-npx-commands.md
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-commands)

NPX (NPM Package Runner) Commands

List of useful npx (NPM Package Runner) commands.

What is NPX?

Using NPX we can execute/run node binaries without the need to install it locally or globally.

Commands

@chrisciampoli
chrisciampoli / starship.toml
Created October 24, 2019 19:15 — forked from ryo-ARAKI/starship.toml
Starship configuration file
# ~/.config/starship.toml
[character]
use_symbol_for_status = true # Show "✖" when the command faild
[hostname]
ssh_only = false
prefix = "❮ "
suffix = "❯"
style = "bold dimmed white"
@chrisciampoli
chrisciampoli / complex-curl.sh
Created October 12, 2016 22:28 — forked from christeredvartsen/complex-curl.sh
Querying elasticsearch with Elastica
#!/bin/bash
curl -XPOST 'http://localhost:9200/blog/posts/_search' -d '{
"query": {
"filtered": {
"query": {
"query_string": {
"query":"php zend framework",
"default_operator": "OR",
"fields": ["title", "content"]
}
RecipesData = {
"chilis-chicken-taco": {
"title": "Chilis Chicken Tacos",
"highlighted": true,
"excerpt": "When I’ve got too many cheese bits on hand, it's now fromage fort to the rescue",
"source": {
"name": "Chilis",
"url": "http://chilis.com/"
},
"average preperation time": "15 min",
Clock Angle Problem
BY SJ · FEBRUARY 20, 2015
Objec­tive: Find the Angle between hour hand and minute hand at the given time.
Exam­ple:
Time : 12:45
Input : hour = 12, Minute = 45
Output : 112.5
@chrisciampoli
chrisciampoli / test.php
Created March 8, 2016 00:22
array_map vs foreach testing PHP
1
down vote
It's interesting. But I've got an opposite result with the following codes which are simplified from my current projects:
// test a simple array_map in the real world.
function test_array_map($data){
return array_map(function($row){
return array(
'productId' => $row['id'] + 1,
Requirements
Installable on both iOS and Android
Shopping Cart
Reminders
CMS page for wordpress to push out messages to app
Social signon
Link to write review
@chrisciampoli
chrisciampoli / setup.txt
Created January 19, 2016 00:25
Pelican Setup
1) unzip package to project folder
2) virtualenv .
3) source bin/activate
4) pip install pelican markdown
5) cd src
6) git clone https://github.com/getpelican/pelican-plugins.git
7) Add PLUGIN_PATHS = ['pelican-plugins'] and PLUGINS = ['assets'] to pelicanconf.py
8) cd ..
9) cd theme
10) ./setup.sh