Skip to content

Instantly share code, notes, and snippets.

View sayfulloev's full-sized avatar

Sharif sayfulloev

View GitHub Profile
@bhattisatish
bhattisatish / EDI_Formatter
Created July 12, 2014 03:21
EDI Custom Plugin for Notepad++
<NotepadPlus>
<UserLang name="X12" ext="">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+"></Keywords>
@maxcnunes
maxcnunes / curl-get-status-code-and-response-body.sh
Created November 24, 2015 17:52
Curl - Get status code and response body
URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active April 17, 2024 17:26
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {