Skip to content

Instantly share code, notes, and snippets.

View wKovacs64's full-sized avatar
🍸

Justin Hall wKovacs64

🍸
View GitHub Profile
@AKiniyalocts
AKiniyalocts / nav_drawer_toolbar.xml
Last active August 29, 2015 14:08
Incorporating the new appcompat-v7 ToolBar with the Navigation Drawer
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_material_dark"
android:layout_marginTop="@dimen/status_bar_padding"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
@jmporchet
jmporchet / EditPlanDetails.test.js
Created April 1, 2019 16:57
How to test componentDidUpdate with react-native-testing-library
import React from 'react';
import { render, fireEvent } from 'react-native-testing-library';
import { _EditPlanDetails as EditPlanDetails } from '../Settings/EditPlanDetails';
// Scrollviews are bugged in the current Expo/RN release and won't render in tests https://github.com/expo/expo/issues/2806#issuecomment-465373231
jest.mock('ScrollView', () => require.requireMock('ScrollViewMock'));
describe('EditPlanDetails', () => {
const props = {
subscription: {
<head>
<!-- this will run -->
<style nonce='1234'>
.a {
color: red;
}
</style>
<!-- this won't run -->
<style>
/**
* @typedef {Object} ClassifyProps
* @property {React.ElementType} [as] - Element to render
* @property {import('clsx').ClassValue} [className] - Composable classnames passed to clsx
*/
/**
* @param {ClassifyProps} props
*/
function Classify({ as: El = "div", ...props }) {
@arnars
arnars / Gatsby v2 using Internet Explorer.md
Last active February 15, 2021 08:01
Tips for making Gatsby v2 working with IE / Internet Explorer

Making Gatsby work with Internet Explorer 10 and 11

I created this gist in order to help myself and others keep track of tips and tricks in order to make Gatsby v2 play nicely with Internet Explorer 10 and 11.

This is experience based. Please share your experiences when you have a solution to a problem.

External compilation of modules

If you suspect that an es6-based module is breaking your app, then try to add gatsby-plugin-compile-es6-packages and include the package as one of the modules.

@sjkp
sjkp / sp2013 include reputation
Last active March 17, 2021 10:44
SharePoint 2013, how to enable like/unlike functionality by client side javascript on a publishing pagelayout. - Requirements, like functionality is enabled on the page library. - You must include reputation.js if you are wrapping this in a webcontrol, that can e.g. be done with: ScriptLink.RegisterScriptAfterUI(this.Page, "reputation.js", false);
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<SharePointWebControls:ScriptLink language="javascript" name="reputation.js" OnDemand="false" LoadAfterUI="true" runat="server" Localizable="false" />
@flybayer
flybayer / Link.tsx
Last active July 1, 2021 07:40
Much nicer and more intuitive Next.js Link abstraction
@wesbos
wesbos / service-worker.js
Created March 24, 2022 18:26
Nuke a service worker from inside a service worker
// put this in a file where your service worker used to live, like yourdomain.com/service-worker.js. You can find out this path in the SW dev tools of your browser
self.addEventListener('install', (e) => {
console.log('[Service Worker] Installing Service Worker ...', e);
self.skipWaiting();
});
self.addEventListener('activate', (e) => {
console.log('[ServiceWorker] Activate');
self.registration
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@bfoz
bfoz / fixup_committer_date.sh
Created September 7, 2010 19:24
Force GIT_COMMITTER_DATE = GIT_AUTHOR_DATE
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"'