Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Building a International Wallet with Laravel, VueJS, React-Native.

Shyam Sunder Verma ssv445

💭
Building a International Wallet with Laravel, VueJS, React-Native.
View GitHub Profile
@ssv445
ssv445 / .htaccess
Last active Aug 6, 2020
Laravel Apache hide .env and several security settings via .htaccess
View .htaccess
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden // in here specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
# in here specify full file name sperator '|'
View Session.php
<?php
namespace App\Sk\Session;
use App\Sk\SkApi;
use Carbon\Carbon;
use App\Sk\SkModel;
use App\Sk\SkPayload;
use App\Sk\User\User;
@ssv445
ssv445 / gist:dfeda39756cf7bfe3f38550c50673dce
Created Jul 22, 2018 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs
View gist:dfeda39756cf7bfe3f38550c50673dce

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

View cloudSettings
{"lastUpload":"2019-09-04T05:45:33.827Z","extensionVersion":"v3.2.9"}
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@ssv445
ssv445 / README.md
Created Nov 24, 2015 — forked from oodavid/README.md
Backup MySQL to Amazon S3
View README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@ssv445
ssv445 / index.js
Last active Sep 2, 2015 — forked from MoOx/index.js
Export/import github labels
View index.js
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
@ssv445
ssv445 / cron-commit.sh
Created Jul 17, 2014
auto commit folder with changed file as commit message
View cron-commit.sh
#!/bin/bash
# move to www folder
cd /var/www
rm -f commit.msg
# add files
git add .
# build commit message
@ssv445
ssv445 / setperm.sh
Created Apr 23, 2014
Setup file permission in Joomla CMS
View setperm.sh
#!/bin/bash
pwd=${PWD}
[[ $pwd =~ ^/var/www* ]] || exit 0
echo 'PWD is subdirectory of /var/www, applying permissions ...'
find . -exec chown www-data:www-data {} \;
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
@ssv445
ssv445 / update-joomla-config.php
Last active Dec 27, 2015
PHP CLI script to update Joomla configuration file
View update-joomla-config.php
<?php
//
$joomlaroot = isset($argv[1]) ? $argv[1] : die("First argument required and it should be absolute-joomla-root-path");
$i=2;
$args = array();
while($i <= $argc){