Skip to content

Instantly share code, notes, and snippets.

@varenc
varenc / dropbox_pause_resume_example.applescript
Created May 1, 2021 03:01
Pause and Resume Dropbox's syncing from the command line with AppleScript
tell application "System Events"
-- Pause syncing
click menu bar item 1 of menu bar 2 of application process "Dropbox"
click menu item "Pause Syncing" of menu 1 of menu bar item 1 of menu bar 2 of application process "Dropbox"
delay 2
-- Now re-enable syncing
click menu bar item 1 of menu bar 2 of application process "Dropbox"
click menu item "Resume Syncing" of menu 1 of menu bar item 1 of menu bar 2 of application process "Dropbox"
end tell
@matiaslopezd
matiaslopezd / webhook.header.txt
Last active June 12, 2024 15:53
Woocommerce webhook payload and header example
expect 100-continue
content-length 1998
connection close
x-wc-webhook-delivery-id 36e520ebabc2fa725092ff4a47acedf2
x-wc-webhook-id 3
x-wc-webhook-signature 5poyFy4qB6fdvvT5pGbefZmfkpL48uD47F0WYwfmpo4=
x-wc-webhook-event created
x-wc-webhook-resource order
x-wc-webhook-topic order.created
x-wc-webhook-source https://www.website.com/
@vktr
vktr / rule.js
Created February 10, 2018 18:54
Add Stripe Customer Id to Auth0 via custom rule
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
if ('stripe_customer_id' in user.app_metadata) {
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id;
return callback(null, user, context);
}
var stripe = require('stripe')('sk_....');
var customer = {
@PaulGwamanda
PaulGwamanda / wowjs-repeat-animation.js
Created November 2, 2017 09:49
Wow.js repeat animation on scroll up or down
WOW.prototype.addBox = function(element) {
this.boxes.push(element);
};
// Init WOW.js and get instance
var wow = new WOW();
wow.init();
// Attach scrollSpy to .wow elements for detect view exit events,
// then reset elements and add again for animation
class SignInModal extends Component {
componentDidMount() {
this.InputComponent.focus();
}
render() {
return (
<div>
<label>User name: </label>
<Input
class Input extends Component {
focus() {
this.el.focus();
}
render() {
return (
<input
ref={el=> { this.el = el; }}
/>
import HomePage from './HomePage.jsx';
import AboutPage from './AboutPage.jsx';
import UserPage from './UserPage.jsx';
import FourOhFourPage from './FourOhFourPage.jsx';
const PAGES = {
home: HomePage,
about: AboutPage,
user: UserPage,
};
@superKalo
superKalo / Sortable.jsx
Last active August 9, 2022 09:31
How to use jQuery UI with React JS? You can use this approach to integrate almost any jQuery plugin! Full details and explanation here: http://stackoverflow.com/a/40350880/1333836
class Sortable extends React.Component {
componentDidMount() {
// Every React component has a function that exposes the
// underlying DOM node that it is wrapping. We can use that
// DOM node, pass it to jQuery and initialize the plugin.
// You'll find that many jQuery plugins follow this same pattern
// and you'll be able to pass the component DOM node to jQuery
// and call the plugin function.
@kjschulz
kjschulz / TiCloudinary.js
Last active May 10, 2016 16:10 — forked from yozef/TiCloudinary
Appcelerator Titanium code for uploading a TiBlob image object, transforming, and deleting stored images via the Cloudinary API
var moment = require('alloy/moment');
// Cloudinary credentials - **Replace these with your creds!!!
var cloudName = 'Your_Cloud_Name';
var apiKey = 999999999999;
var apiSecret = 'XXXXXXXXXX-XXXXX-XX';
// Image API URL base
var apiBaseUrl = 'http://api.cloudinary.com/v1_1/';
// Create and send alert on error
function alert(message, title, ok, callback) {
@glueckpress
glueckpress / sample-admin-notice.php
Last active October 30, 2022 15:03
[WordPress] Sample Admin Notices
<?php
defined( 'ABSPATH' ) or die( 'Poop.' );
/**
* Plugin Name: _Sample Admin Notice
* Description: Displays a sample admin notice once for admins. (Requires PHP 5.3+.)
* Version: 0.1
* Author: Caspar Hübinger
* Plugin URI: https://gist.github.com/glueckpress/6befeb937da89025d4d8#file-sample-admin-notice-php
* Author URI: https://profiles.wordpress.org/glueckpress
* License: GNU General Public License v3