Skip to content

Instantly share code, notes, and snippets.

View dayitv89's full-sized avatar
🎢
Rising

Gaurav D. Sharma dayitv89

🎢
Rising
View GitHub Profile
@dayitv89
dayitv89 / AdonisJS4.1_Readme.md
Last active June 28, 2021 16:53
AdonisJS 4.1 essentials

403 CSRF issue for APIs or webhooks

On file config/shield.js at csrf key default is filterUris: [],

change this to filterUris: [/^\/webhooks\//, /^\/api\/v1/],

Add csrf values

at head section add {{ cspMeta() }}

at form add {{ csrfField() }}

@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@pythonicrubyist
pythonicrubyist / nil_empty_blank_present_ffdierence_in_ruby
Last active February 21, 2024 17:38
Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass
@dpogorzelski
dpogorzelski / gunzip.js
Created May 21, 2013 15:53
Read http request's body which has a gzip content encoding (node.js);
var https = require('https');
var gunzip = require('zlib').createGunzip();
var options = {
host: 'api.stackexchange.com',
path: '/2.1/info?site=stackoverflow'
};
https.get(options, function(res) {
var body = '';