Skip to content

Instantly share code, notes, and snippets.

#taken from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
find . -name "node_modules" -exec rm -rf '{}' +
import sanitizeQuery from 'helper/sanitizeQuery';
import serialize from 'helper/serialize';
const getSuccessActionType = KEY =>
type => [ KEY, type.toUpperCase(), 'SUCCESS' ].join('_');
const initialCollectionState = {
items: {},
list: {},
infiniteList: {},
@viankakrisna
viankakrisna / restate.js
Last active February 21, 2017 22:15
state-component -- state manager using React's own state
let persist = false;
let ref = null;
export function setStateContainer(componentInstance, isPersist) {
ref = componentInstance;
persist = isPersist;
}
export function isPersist() {
return persist;
@viankakrisna
viankakrisna / php2jsx.js
Last active April 26, 2017 13:18
php2jsx
var string = `copy your php here`
console.log(
string
.replace(/class=/g, 'className=')
.replace(/<\?php/g, '{')
.replace(/\?>/g, '}')
.replace(/echo/g, '')
.replace(/{ endif; }/g, '}')
VBoxManage modifyvm "OSX" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "OSX" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "OSX" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
export default function importModule(moduleName) {
return new Promise(resolve => {
require.ensure([moduleName], () => {
resolve(require(moduleName));
});
});
}
<?php
/*
Plugin Name: Unauthorized Media Upload
*/
add_action('rest_api_init', function () {
register_rest_route('unauthorized-upload/v1', '/media', array(
'methods' => 'POST',
'callback' => 'unauthorized_upload',
));
});
module.exports = function LastFMFactory ($http, CONFIG) {
'ngInject'
return {
geo: {
getTopArtists: function () {
return $http.get(CONFIG.lastfm_url + '?format=json&method=geo.getTopArtists&country=indonesia&api_key=' + CONFIG.lastfm_key)
},
getTopTracks: function () {
}
{
"ace": {
"@animatedScroll": true,
"@antialiasedfonts": false,
"@behavioursEnabled": true,
"@cursorStyle": "ace",
"@displayIndentGuides": true,
"@fadeFoldWidgets": true,
"@fontFamily": "Fira Code, monospace",
"@fontSize": 16,
document.head.innerHTML = '<style>body { margin: 0 auto; padding: 0; max-width: 30em; font-family: "Georgia"; line-height: 1.5; font-size: 1.3em} img { max-width: 100%; height: auto } svg { display: none; } </style>'