Skip to content

Instantly share code, notes, and snippets.

View shprink's full-sized avatar
🏠
Working from home

Julien Renaux shprink

🏠
Working from home
View GitHub Profile
@cereallarceny
cereallarceny / index.js
Created October 12, 2017 20:37
Server-side rendering with create-react-app (Fiber), React Router v4, Helmet, Redux, and Thunk
// Ignore those pesky styles
require('ignore-styles');
// Set up babel to do its thing... env for the latest toys, react-app for CRA
require('babel-register')({
ignore: /\/(build|node_modules)\//,
presets: ['env', 'react-app']
});
// Now that the nonsense is over... load up the server entry point
@pgaskin
pgaskin / PrintRevealNotes.js
Last active May 3, 2024 21:23
Prints speaker notes for a reveal.js presentation.
/*
Prints speaker notes for a reveal.js presentation.
To print the notes, run the js function PrintRevealNotes()
You need to disable the pop-up blocker
Copyright 2016 Patrick G
http://geek1011.github.io
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
@jackcarter
jackcarter / slack_delete.py
Last active November 29, 2023 07:03
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@scottopolis
scottopolis / wp-api-custom-taxonomies.php
Created October 27, 2015 22:27
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@ahmadawais
ahmadawais / Emmet.sublime-settings
Created October 17, 2015 16:05
SUBLIME: Emmet User Settings
{
// Copy any modified settings to `User/Emmet.sublime-settings`
// otherwise modifications will not survive updates.
// Path to folder where Emmet should look for extensions
// http://docs.emmet.io/customization/
"extensions_path": "~/emmet",
// Disable completions of HTML attributes
// with this option disabled, you can get attribute list completions
@boyney123
boyney123 / run_ionic_app_on_all_connected_android_devices.sh
Last active September 29, 2015 06:56
Simple bash script to remove, build, install and launch your ionic app on all connected android devices (android simulators or actual devices).
#!/bin/sh
#Your app id which can be found in your config.xml file (widget id)
app=com.ionicframework.myNewApp
pathToAPK=platforms/android/build/outputs/apk/android-debug.apk
echo "Running Ionic Build"
ionic build
angular.module('maxlynch')
/**
* A simple ace-editor widget for adding a rich code editor
* in place of a textarea with full ngModel support.
*
* Usage:
*
* <ace-editor language="javascript" theme="monokai"></ace-editor>
*
@kentcdodds
kentcdodds / get-watchers.js
Last active December 4, 2023 22:34
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));