Skip to content

Instantly share code, notes, and snippets.

View gopalindians's full-sized avatar
🕶️
.

Gopal Sharma gopalindians

🕶️
.
View GitHub Profile

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@linktohack
linktohack / index.php
Created June 20, 2016 07:20
Adminer 4.2.5 loader without password for SQLite
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
return true;
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";
@MahbbRah
MahbbRah / Javascript_fetch_request_php_server.md
Last active January 9, 2020 09:30
Making http POST/GET request from React-Native/React/Javascript side (Using Fetch API) to PHP server
// A function that sends http POST request to PHP server by using Javascript Fetch API with async/await :) 
async function POST(url, payload){

    var body = Object.keys(payload).map((key) => {
        return encodeURIComponent(key) + '=' + encodeURIComponent(payload[key]);
    }).join('&');

 let options = {
@krakjoe
krakjoe / pool.md
Last active January 30, 2020 12:33
Pooling

Easy pthreads Pools

The final solution !!

Since the first version of pthreads, PHP has had the ability to initialize Worker threads for users. Onto those Worker threads are stacked objects of class Stackable for execution concurrently.

The objects stacked onto workers do not have their reference counts changed, pthreads forces the user to maintain the reference counts in userland, for the extremely good reason that this enables the programmer to keep control of memory usage; and so, execute indefinitely.

This is the cause of much heartache for newcomers to pthreads; if you do not maintain references properly you will, definitely, experience segmentation faults.

@tylersloeper
tylersloeper / Arrays: Left Rotation in C
Last active April 15, 2020 17:32
Hacker Rank: Arrays: Left Rotation, (in c, c#, php, and javascript)
/**
The challenge:
https://www.hackerrank.com/challenges/ctci-array-left-rotation
**/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
@topdown
topdown / CI_phpStorm.php
Created January 29, 2012 05:21
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
@antirez
antirez / wh.md
Last active November 26, 2020 07:18
For white hat hackers setting passwords to open Redis instances

Dear white hat attackers,

recently we observed a number of Redis instances that were targeted by a simple attack, consisting in setting a password using the CONFIG SET requirepass <password> command to instances which are left open on the internet.

This is, in my opinion, a good idea, since those Redis instances are going to be cracked anyway. I believe you are doing this in order to make Redis users aware they forgot to setup firewalling rules in order to make their instances not reachable from the outside.

@branflake2267
branflake2267 / main.dart
Created March 27, 2018 04:37
Flutter - Passing data to the next page. Used in the youtube video.
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@rock3r
rock3r / giffify.py
Last active January 14, 2022 09:00
Giffify - easily create optimised GIFs from a video
#!/usr/bin/python
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile