Skip to content

Instantly share code, notes, and snippets.

View xdmorgan's full-sized avatar
Unverified

Dan Morgan xdmorgan

Unverified
View GitHub Profile
@ChristopherBiscardi
ChristopherBiscardi / yarn-workspace.sh
Last active November 22, 2019 20:05
yarn workspace command
# yw develop
yw() {
yarn workspace $(yarn workspaces info --json | jq '.data' -r | jq "[keys][0] []" -r | fzf) $@
}
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@GingerBear
GingerBear / react-native-start-with-link.js
Last active January 5, 2023 01:19
start react native bunlder with link
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@aaronfischer
aaronfischer / gist:8961255
Last active April 22, 2019 09:52
Lead Form Tracking
/*-------------------------------------------------------------------
*
* TRACK SOURCE WITH A COOKIE
* This will check if the query and save its values into a cookie for 180 days and will only be removed if they clear their cookies or if they visit via another source query
* ex. http://rmcad.edu/event/rmcad-create-day-0?utm_source=Social&utm_medium=Twitter&utm_campaign=CreateDay2.15
* utm_source = Social
* utm_medium = Twitter
* utm_campaign = CreateDay2.15
*
-------------------------------------------------------------------*/
@thoop
thoop / .htaccess
Last active January 27, 2024 14:07
Official prerender.io .htaccess for Apache.
# Change YOUR_TOKEN to your prerender token
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
using System.Collections.Generic;
using System.Drawing;
using MonoTouch.CoreAnimation;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.ImageIO;
using MonoTouch.UIKit;
namespace PuppyKittyOverflow.Touch
{
@redent
redent / ParentViewController.Keyboard.cs
Last active May 2, 2018 21:47
Parent view controller to handle keyboard notifications to center views in the screen. UIScrollView related methods moved to an extension class.
using System;
using Foundation;
using UIKit;
using TwinCoders.TouchUtils.Extensions;
using CoreGraphics;
namespace SalesForce.Touch.Views
{
public abstract partial class ParentViewController
{
@jxnblk
jxnblk / .htaccess
Last active March 12, 2023 12:25
.htaccess for using AngularJS's in HTML5 mode on Media Temple
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
@itsme-renee
itsme-renee / gist:5576044
Created May 14, 2013 13:54
git post receive hook example
#!/bin/bash
##change website.com to your website
APP_PATH=/var/www/website.com
exit_with_error() {
echo "[DEPLOY] !!!!!!!!!!!!!!!!!!!! An error has occurred !!!!!!!!!!!!!!!!!!!!!!!"
exit 1
}