Skip to content

Instantly share code, notes, and snippets.

View sanjeevshrestha's full-sized avatar
💭
I may be slow to respond.

Sanjeev Shrestha sanjeevshrestha

💭
I may be slow to respond.
View GitHub Profile
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
@vasanthk
vasanthk / System Design.md
Last active May 9, 2024 16:45
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@VladSem
VladSem / tmux2_raspberry.sh
Created May 23, 2015 05:43
install tmux 2.0 on Raspberry Pi (Debian 7.8) Raspbian Wheezy
#!/bin/bash
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
tar -xf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make verify
sudo make install
sudo ldconfig
@peterhurford
peterhurford / r-interview.md
Last active January 12, 2022 21:55
R Interview Questions

1.) If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...

1a.) How do I select the c(4, 5, 6)?

1b.) How do I select the 1?

1c.) How do I select the 5?

1d.) What is df[, 3]?

@maxivak
maxivak / 00. tutorial.md
Last active April 12, 2024 05:42
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@chrisguitarguy
chrisguitarguy / commandbus.py
Last active January 6, 2022 23:56
Command bus pattern in Python.
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Playing Around with the Command Bus Pattern in Python
"""
import inspect
import collections
@aweijnitz
aweijnitz / Vagrantfile
Last active March 25, 2024 13:54
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@rtoal
rtoal / MontyPython.java
Created January 8, 2014 02:10
Uses reflection to count like King Arthur with the Holy Hand Grenade
import java.lang.reflect.Field;
public class MontyPython {
public static void main(String[] args) throws Exception {
Field v = Integer.class.getDeclaredField("value");
v.setAccessible(true);
v.set(3,5);
System.out.printf("Ready the holy hand grenade!\n");
Thread.sleep(1000);
System.out.printf("%d\n", 1);
Thread.sleep(1000);
@andrewjmead
andrewjmead / app.js
Last active December 22, 2016 03:41
An AngularJs directive for smart inline editing.
/* demo app that uses the inline directive */
var myApp = angular.module('inlineDemo', ['inline']);
myApp.config(function ($routeProvider) {});
myApp.controller('names', function ($scope) {
console.log('controller');
$scope.masterName = $scope.name = '46';