Skip to content

Instantly share code, notes, and snippets.

@rhalff
rhalff / example.dart
Created February 15, 2019 02:05 — forked from sma/example.dart
A flutter example demonstrating a custom painter drawing selectable rects
class RectsExample extends StatefulWidget {
@override
_RectsExampleState createState() => _RectsExampleState();
}
class _RectsExampleState extends State<RectsExample> {
int _index = -1;
@override
Widget build(BuildContext context) {
@lorisleiva
lorisleiva / PaymentRequest.js
Created June 4, 2018 22:02
Renderless VueJS component for Payment Requests using Stripe Element
export default {
props: {
stripe: {
type: String,
required: true,
},
options: {
type: Object,
required: true,
}
@muralikg
muralikg / background.js
Last active July 29, 2024 14:29
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@sebtoun
sebtoun / Easing.cs
Last active January 28, 2022 14:18 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity with support for Inspector with animation preview and Animation Curve for custom easing
using System;
using UnityEngine;
[ Serializable ]
public class Easing
{
public enum EasingType
{
Curve,
Function
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{
@SynCap
SynCap / remove_node_modules_recursively.ps1
Last active August 20, 2024 23:27
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf
@MattRix
MattRix / ObjExporter.cs
Last active June 21, 2024 06:31
Exports Unity meshes to an obj file
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using System.Text;
public class ObjExporterScript
{
private static int StartIndex = 0;
@clemlatz
clemlatz / nginx-config.conf
Last active December 23, 2022 10:43
Set up ssl proxy with nginx and letsencrypt (https://secure.example.com => http://example.com)
# SSL server config
server {
listen 443 ssl;
server_name secure.example.com;
ssl_certificate /etc/letsencrypt/live/secure.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/secure.example.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@jtrefry
jtrefry / Win10-64bit-npm.md
Last active September 6, 2023 07:30
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse

First of all, this is not my brilliant effort to get react-native working on Windows, it is the collation of work by others, particularly @mqli and @Bernd Wessels. I've just summarised what worked for me.

If you would prefer to read what I've plagerised, head over to mqli's great gist

Disclaimer

  • The below is tested with react-native-cli 0.1.5, react-native 0.12.0 on Windows 10, node 4.1.1, and Android (physical Nexus 6 and AVD with API v22)
  • I hope this will all be redundant in a few weeks. Please comment on stuff that is now fixed and I will update this to keep it relevant.
  • Sprinkle a bit of YMMV around

Keep this github issue handy, it’s the bucket for all Windows/Linux related tricks to get RN working.