Skip to content

Instantly share code, notes, and snippets.

@nikst
nikst / eloquent.md
Last active August 29, 2015 14:15 — forked from msurguy/eloquent.md

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@nikst
nikst / bitstuffing.c
Created February 11, 2015 06:23
Zero bit stuffing for data link layer
#include <stdio.h>
#include <stdlib.h>
int main(){
int i=0,count=0;
char a[100];
printf("enter the bits : ");
scanf("%s",a);
printf("\nAfter bit stuffing \n");
@nikst
nikst / Snippet:Send_mail_php
Created January 31, 2015 15:57
Send mail in 10sec
<?php
require_once 'vendor/autoload.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password')
;
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
@nikst
nikst / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console