Skip to content

Instantly share code, notes, and snippets.

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active July 25, 2024 03:38
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@ispern
ispern / gist:5675447
Last active December 17, 2015 21:29
show FPS - Sencha Touch 2.2
Ext.Viewport.add([
{
id : 'currentFPS',
xtype : 'component',
bottom: 0,
right : 0,
width : 50,
height: 50,
style : 'background-color: red; color: white;'
},

This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.

@zenparsing
zenparsing / dedent-template.js
Last active April 25, 2023 22:16
Dedenting Template Strings
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active June 20, 2024 17:13
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@brock
brock / lock.scpt
Created January 19, 2015 16:46
AppleScripts to lock and unlock a macbook
tell application "System Events"
tell security preferences
set require password to wake to true
end tell
end tell
activate application "ScreenSaverEngine"
@tjbenton
tjbenton / has_events.js
Created August 12, 2015 20:32
Utility to list out elements that have event listeners. Their listeners will be listed out in the console.
/// @name has_events
/// @author Tyler Benton
/// @description
/// Utility to list out elements that have event listeners. Their listeners will be listed out in the console.
/// @arg {string} target ["*"]
/// @note {10} - Only works if you copy this code and paste it in the chrome console.
/// @markup {js}
/// has_events(); // lists out all elements
/// has_events("a"); // lists out all anchor tags that have event listeners
function has_events(target){
@cabeca
cabeca / simulator_populator_xcode7
Last active April 16, 2020 09:18
This script removes and recreates all simulators in Xcode 7.
#!/usr/bin/env ruby
require 'JSON'
device_types = JSON.parse `xcrun simctl list -j devicetypes`
runtimes = JSON.parse `xcrun simctl list -j runtimes`
devices = JSON.parse `xcrun simctl list -j devices`
devices['devices'].each do |runtime, runtime_devices|
runtime_devices.each do |device|
@zkat
zkat / index.js
Last active July 8, 2024 04:39
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@SaraVieira
SaraVieira / gist file.md
Last active December 5, 2023 11:59
The Origin of Furries

In this talk we will be all discussing the origin of the furry fandom. How we will thogheter create a new furry-in-js framework. We will going over how they have changed the current fandom world, our hearts and the js world in 5 very awesome minutes! This talk is to prove a point that stars mean nothing in this case.

https://reactiveconf.com/