This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| export const createGenericContext = <T extends unknown>() => { | |
| // Create a context with a generic parameter or undefined | |
| const genericContext = React.createContext<T | undefined>(undefined); | |
| // Check if the value provided to the context is defined or throw an error | |
| const useGenericContext = () => { | |
| const contextIsDefined = React.useContext(genericContext); | |
| if (!contextIsDefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Apache configuration file | |
| # httpd.apache.org/docs/2.2/mod/quickreference.html | |
| # Note .htaccess files are an overhead, this logic should be in your Apache | |
| # config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html | |
| # Techniques in here adapted from all over, including: | |
| # Kroc Camen: camendesign.com/.htaccess | |
| # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
| # Sample .htaccess file of CMS MODx: modxcms.com | |
| # This is the free sample of .htaccess from 6GO s.r.l. | |
| # @author Claudio Ludovico Panetta (@Ludo237) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Byobu Commands | |
| ============== | |
| byobu Screen manager | |
| Level 0 Commands (Quick Start) | |
| ------------------------------ | |
| <F2> Create a new window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #target photoshop | |
| // $.level = 2; | |
| /* | |
| * Script by Tomek Cejner (tomek (at) japko dot info) | |
| * based on work of Damien van Holten: | |
| * http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/ | |
| * | |
| * My version adds support of nested layer groups, | |
| * and exports single layers in addition to groups. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Include required modules. | |
| var net = require('net'); | |
| var sys = require('sys'); | |
| // Create a TCP server and listen on FastAGI port. | |
| var server = net.createServer(); | |
| server.listen(4573, '127.0.0.7'); | |
| // Add a listener for new connections. | |
| server.addListener('connection', fastAGI); |