Skip to content

Instantly share code, notes, and snippets.

👨‍💻
At Office

Jagroop Singh jagroop

👨‍💻
At Office
Block or report user

Report or block jagroop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shawnlindstrom
shawnlindstrom / TwilioServiceProvider.php
Created Jul 4, 2018
Twilio Service Provider for Laravel
View TwilioServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Twilio\Rest\Client as TwilioService;
class TwilioServiceProvider extends ServiceProvider
{
public function register()
@gabmontes
gabmontes / delete-all-my-gists.js
Last active Dec 28, 2018
Delete all your gists
View delete-all-my-gists.js
var async = require('async');
var GitHubApi = require('github');
var github = new GitHubApi({
version: '3.0.0',
protocol: 'https'
});
github.authenticate({
type: 'basic',
@PurpleBooth
PurpleBooth / README-Template.md
Last active Aug 24, 2019
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@RuGa
RuGa / massInsertOrUpdate.php
Last active Aug 22, 2019
Mass (bulk) insert or update on duplicate for Laravel 4/5
View massInsertOrUpdate.php
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@dennysfredericci
dennysfredericci / search-ul-li-item.js
Created Jul 22, 2014
A simple jquery code to search a text inside of li tag
View search-ul-li-item.js
//searchText is a input type text
$('#searchText').bind('keyup', function() {
var searchString = $(this).val();
$("ul li").each(function(index, value) {
currentName = $(value).text()
if( currentName.toUpperCase().indexOf(searchString.toUpperCase()) > -1) {
@FrostyX
FrostyX / FacebookDebugger.php
Last active Jun 12, 2019
Facebook API - Force facebook to reload cache from your website
View FacebookDebugger.php
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active Aug 24, 2019
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
View Git push deployment in 7 easy steps.md
@isimmons
isimmons / gist:8202227
Last active May 23, 2019
Truncate tables with foreign key constraints in a Laravel seed file.
View gist:8202227

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@chill117
chill117 / mysql_backup.sh
Last active Apr 7, 2019
Bash script to perform backups on one or more MySQL databases.
View mysql_backup.sh
#!/bin/bash
#
# Use this script to perform backups of one or more MySQL databases.
#
# Databases that you wish to be backed up by this script. You can have any number of databases specified; encapsilate each database name in single quotes and separate each database name by a space.
#
# Example:
# databases=( '__DATABASE_1__' '__DATABASE_2__' )
@joshhartman
joshhartman / mcrypt-cbc.php
Last active Jul 10, 2019
Rijndael 256-bit Encryption Function (CBC)
View mcrypt-cbc.php
<?php
// Define a 32-byte (64 character) hexadecimal encryption key
// Note: The same encryption key used to encrypt the data must be used to decrypt the data
define('ENCRYPTION_KEY', 'd0a7e7997b6d5fcd55f4b5c32611b87cd923e88837b63bf2941ef819dc8ca282');
// Encrypt Function
function mc_encrypt($encrypt, $key){
$encrypt = serialize($encrypt);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
$key = pack('H*', $key);
You can’t perform that action at this time.