You have a file where you want to replace several strings.
Example :
file.json
[
{"category": "personalCare"},
{"category": "atm"},
You have a file where you want to replace several strings.
Example :
file.json
[
{"category": "personalCare"},
{"category": "atm"},
To automatically add emojis to your commits, you can use the commit-msg
hook.
$ git init
$ ln -s commit-msg-emoji .git/hooks/commit-msg
To remove CSS modules from a repository, these steps can help.
codemod --extension 'jsx' 'styles\[(.*?)\]' '\1' # className={styles['a]} -> className={'a'}
find . | grep '.jsx$' | xargs jscodeshift --parser babel -t simpleClassNames.js # className={classNames('a', 'b', 'c')} -> className='a b c'
Check well, adjust manually and you are good to go.
const App = function () { | |
return <div>Hello World !</div> | |
} | |
export default App |
const queryAll = function (cozyClient, mangoIndex, options) { | |
return new Promise((resolve, reject) => { | |
const documents = [] | |
const fetch = function () { | |
return cozyClient.data.query(mangoIndex, options) | |
.then(onSuccess) | |
.catch(reject) | |
} | |
const onSuccess = function (docs, response) { | |
debugger |
class LeafletJSONField(JSONField): | |
widget = LeafletWidget(width='100%', height='400px') | |
def process_formdata(self, valuelist): | |
if valuelist: | |
value = valuelist[0] | |
if not value: | |
self.data = None | |
return | |
try: |
#!/bin/sh | |
# Make a gif from a video using optimized palette | |
# | |
# Usage: make-gif video.mov video.gif 200 | |
# | |
# Will output a gif with width 200px | |
# You can use iw in the width expression to have the width of the input | |
# video : iw*0.5 will make the gif half the size of the video (useful | |
# for Retina displays) | |
# |
from collections import defaultdict | |
from xml.etree import cElementTree as ET | |
def etree_to_dict(t): | |
# remove namespace | |
if hasattr(t.tag, 'find'): | |
i = t.tag.find('}') | |
if i >= 0: | |
t.tag = t.tag[i+1:] |
var url = require('url'); | |
var SockJS = require("sockjs-client"); | |
var stripAnsi = require('strip-ansi'); | |
var scriptElements = document.getElementsByTagName("script"); | |
var scriptHost = scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, ""); | |
// If this bundle is inlined, use the resource query to get the correct url. | |
// Else, get the url from the <script> this file was called with. | |
var urlParts; | |
if (typeof __resourceQuery === "string" && __resourceQuery) { |